def iterator(infile):
    while 1:
        line = infile.readline()
        if not line:
            raise StopIteration
        if line[0] == "#":
            continue
        if line.startswith("match"):
            continue
        if line.startswith("psLayout version 3"):
            for x in range(4):
                infile.readline()
            continue
        match = Match()
        match.fromTable(line[:-1].split())
        yield match
iterate over the contents of a psl file.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/BlatTest.py/iterator