Commit 18a95590 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Make txn_list attribute private.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2556 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 067bf8a7
...@@ -98,7 +98,7 @@ class Iterator(object): ...@@ -98,7 +98,7 @@ class Iterator(object):
def __init__(self, app, start, stop): def __init__(self, app, start, stop):
self.app = app self.app = app
self.txn_list = [] self._txn_list = []
assert None not in (start, stop) assert None not in (start, stop)
self._start = start self._start = start
self._stop = stop self._stop = stop
...@@ -122,15 +122,15 @@ class Iterator(object): ...@@ -122,15 +122,15 @@ class Iterator(object):
""" Return an iterator for the next transaction""" """ Return an iterator for the next transaction"""
if self._closed: if self._closed:
raise IOError, 'iterator closed' raise IOError, 'iterator closed'
if not self.txn_list: if not self._txn_list:
(max_tid, chunk) = self.app.transactionLog(self._start, self._stop, (max_tid, chunk) = self.app.transactionLog(self._start, self._stop,
CHUNK_LENGTH) CHUNK_LENGTH)
if not chunk: if not chunk:
# nothing more # nothing more
raise StopIteration raise StopIteration
self._start = add64(max_tid, 1) self._start = add64(max_tid, 1)
self.txn_list = chunk self._txn_list = chunk
txn = self.txn_list.pop(0) txn = self._txn_list.pop(0)
self._index += 1 self._index += 1
tid = txn['id'] tid = txn['id']
user = txn['user_name'] user = txn['user_name']
......
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