[Neo-report] r2512 vincent - in /trunk/neo/client: Storage.py iterator.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Dec 10 14:41:16 CET 2010


Author: vincent
Date: Fri Dec 10 14:41:16 2010
New Revision: 2512

Log:
Provide some iterator-related interfaces.

Modified:
    trunk/neo/client/Storage.py
    trunk/neo/client/iterator.py

Modified: trunk/neo/client/Storage.py
==============================================================================
--- trunk/neo/client/Storage.py [iso-8859-1] (original)
+++ trunk/neo/client/Storage.py [iso-8859-1] Fri Dec 10 14:41:16 2010
@@ -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,

Modified: trunk/neo/client/iterator.py
==============================================================================
--- trunk/neo/client/iterator.py [iso-8859-1] (original)
+++ trunk/neo/client/iterator.py [iso-8859-1] Fri Dec 10 14:41:16 2010
@@ -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 NEOStor
 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




More information about the Neo-report mailing list