#we use this class to easily read the PACKAGES file #an empty line denotes a new package, but readline() usually #doesn't return empty lines class EmptyLinesFile: def __init__(self,myfile): self.file=myfile self.eof=False self.lines=self.generate_lines() def generate_lines(self,size=-1): for line in self.file: yield line self.eof=True def readline(self): try: return self.lines.next() except StopIteration: return ''