def readline(self, size=-1): "Ignore the `size` since a complete line must be processed." while True: try: record = next(self.reader) except StopIteration: break # Ensure this is a valid record if checks.record_is_valid(record): # Process the line cleaned = self.process_line(record) if cleaned: return self.outdel.join([str(x) for x in cleaned]) + '\n' return ''
def readline(self, size=-1): "Ignore the `size` since a complete line must be processed." while True: try: record = next(self.reader) except StopIteration: break # Ensure this is a valid record if checks.record_is_valid(record): if self.use_cache: # Ensures the cache is updated and available self.variants.ensure_cache(record) # Calculate the MD5 of the variant itself (not the record) md5 = calculate_md5(record) # Ensure this variant is not already loaded if not self.use_cache or md5 not in self.variants: cleaned = self.process_line(record) cleaned.append(md5) return self.outdel.join(cleaned) + '\n' return ''