[Zodb-checkins] SVN: ZODB/trunk/src/ZODB/FileStorage/FileStorage.py Changed transaction records to support multiple iteration.
Jim Fulton
jim at zope.com
Sat Oct 25 20:36:47 EDT 2008
Log message for revision 92569:
Changed transaction records to support multiple iteration.
Changed:
U ZODB/trunk/src/ZODB/FileStorage/FileStorage.py
-=-
Modified: ZODB/trunk/src/ZODB/FileStorage/FileStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/FileStorage/FileStorage.py 2008-10-26 00:36:44 UTC (rev 92568)
+++ ZODB/trunk/src/ZODB/FileStorage/FileStorage.py 2008-10-26 00:36:46 UTC (rev 92569)
@@ -1626,8 +1626,7 @@
raise ZODB.interfaces.StorageStopIteration()
-class TransactionRecord(BaseStorage.TransactionRecord, FileStorageFormatter):
- """Iterate over the transactions in a FileStorage file."""
+class TransactionRecord(BaseStorage.TransactionRecord):
def __init__(self, tid, status, user, desc, ext, pos, tend, file, tpos):
BaseStorage.TransactionRecord.__init__(
@@ -1638,6 +1637,18 @@
self._tpos = tpos
def __iter__(self):
+ return TransactionRecordIterator(self)
+
+class TransactionRecordIterator(FileStorageFormatter):
+ """Iterate over the transactions in a FileStorage file."""
+
+ def __init__(self, record):
+ self._file = record._file
+ self._pos = record._pos
+ self._tpos = record._tpos
+ self._tend = record._tend
+
+ def __iter__(self):
return self
def next(self):
More information about the Zodb-checkins
mailing list