Commit a2c624ea authored by Barry Warsaw's avatar Barry Warsaw

_TransactionsIterator.iterator(): Add this so we can pass iterators to

BaseStorage's copyTransactionsFrom() method's "other" argument.
parent e4808a34
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"""Berkeley storage with full undo and versioning support. """Berkeley storage with full undo and versioning support.
$Revision: 1.67 $ $Revision: 1.68 $
""" """
import time import time
...@@ -1791,6 +1791,13 @@ class _TransactionsIterator(_GetItemBase): ...@@ -1791,6 +1791,13 @@ class _TransactionsIterator(_GetItemBase):
# list()-ifying these objects. # list()-ifying these objects.
return 0 return 0
# This allows us to pass an iterator as the `other' argument to
# copyTransactionsFrom() in BaseStorage. The advantage here is that we
# can create the iterator manually, e.g. setting start and stop, and then
# just let copyTransactionsFrom() do its thing.
def iterator(self):
return self
def next(self): def next(self):
"""Return the ith item in the sequence of transaction data. """Return the ith item in the sequence of transaction data.
......
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