1.1 --- a/simplex/__init__.py Sat Oct 01 16:01:22 2011 +0200
1.2 +++ b/simplex/__init__.py Sun Oct 02 16:32:41 2011 +0200
1.3 @@ -46,7 +46,7 @@
1.4 current_key = None
1.5 start_pos = 0
1.6
1.7 - for i, record in enumerate(reader.get_records()):
1.8 + for i, record in enumerate(reader):
1.9 key = accessor.get_key(record)
1.10
1.11 # Where duplicate keys are permitted, the first record employing the key
1.12 @@ -100,7 +100,7 @@
1.13 employing the term or None if no such record was found.
1.14 """
1.15
1.16 - for record in reader.get_records():
1.17 + for record in reader:
1.18 key = accessor.get_key(record)
1.19 if term == key:
1.20 return record
2.1 --- a/simplex/readers.py Sat Oct 01 16:01:22 2011 +0200
2.2 +++ b/simplex/readers.py Sun Oct 02 16:32:41 2011 +0200
2.3 @@ -28,8 +28,8 @@
2.4 def seek(self, pos):
2.5 self.f.seek(pos)
2.6
2.7 - def get_records(self):
2.8 - return self.f.xreadlines()
2.9 + def __iter__(self):
2.10 + return iter(self.f.xreadlines())
2.11
2.12 class DelimitedRecord:
2.13