Commit e17278fc authored by Vincent Pelletier's avatar Vincent Pelletier

Provide some iterator-related interfaces.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2512 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6cd0aa64
......@@ -47,6 +47,10 @@ class Storage(BaseStorage.BaseStorage,
# "restore" missing for the moment, but "store" implements this
# interface.
# ZODB.interfaces.IStorageRestoreable,
# XXX: imperfect iterator implementation:
# - start & stop are not handled (raises if either is not None)
# - transaction isolation is not done
# ZODB.interfaces.IStorageIteration,
)
def __init__(self, master_nodes, name, connector=None, read_only=False,
......
......@@ -16,6 +16,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from ZODB import BaseStorage
from zope.interface import implements
import ZODB.interfaces
from neo import util
from neo.client.exception import NEOStorageCreationUndoneError
from neo.client.exception import NEOStorageNotFoundError
......@@ -23,6 +25,10 @@ from neo.client.exception import NEOStorageNotFoundError
class Record(BaseStorage.DataRecord):
""" TBaseStorageransaction record yielded by the Transaction object """
implements(
ZODB.interfaces.IStorageRecordInformation,
)
def __init__(self, oid, tid, version, data, prev):
self.oid = oid
self.tid = tid
......@@ -40,6 +46,12 @@ class Record(BaseStorage.DataRecord):
class Transaction(BaseStorage.TransactionRecord):
""" Transaction object yielded by the NEO iterator """
implements(
# TODO: add support for "extension" property so we implement entirely
# this interface.
# ZODB.interfaces.IStorageTransactionInformation,
)
def __init__(self, app, tid, status, user, desc, ext, oid_list,
prev_serial_dict):
self.app = app
......
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