Commit 3bf1bfc2 authored by Jim Fulton's avatar Jim Fulton

Changed transaction records to support multiple iteration.

parent 2c3b49fe
......@@ -1626,8 +1626,7 @@ class FileIterator(FileStorageFormatter):
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__(
......@@ -1637,6 +1636,18 @@ class TransactionRecord(BaseStorage.TransactionRecord, FileStorageFormatter):
self._file = file
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment