Commit 86a3c96f authored by Barry Warsaw's avatar Barry Warsaw

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

BaseStorage's copyTransactionsFrom() method's "other" argument.
parent 5ccd8648
......@@ -115,7 +115,7 @@
# may have a back pointer to a version record or to a non-version
# record.
#
__version__='$Revision: 1.125 $'[11:-2]
__version__='$Revision: 1.126 $'[11:-2]
import base64
from cPickle import Pickler, Unpickler, loads
......@@ -2304,6 +2304,13 @@ class FileIterator(Iterator):
# implementation. So just 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 close(self):
file = self._file
if file is not None:
......
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