[Zodb-checkins] SVN: ZODB/branches/jim-storage-api-cleanup/src/ZODB/Connection.py No need to delegate undoLog.

Jim Fulton jim at zope.com
Thu Apr 26 13:05:36 EDT 2007


Log message for revision 74791:
  No need to delegate undoLog.
  
  Only delegate version methods if the original storage supports
  versions.
  

Changed:
  U   ZODB/branches/jim-storage-api-cleanup/src/ZODB/Connection.py

-=-
Modified: ZODB/branches/jim-storage-api-cleanup/src/ZODB/Connection.py
===================================================================
--- ZODB/branches/jim-storage-api-cleanup/src/ZODB/Connection.py	2007-04-26 17:02:55 UTC (rev 74790)
+++ ZODB/branches/jim-storage-api-cleanup/src/ZODB/Connection.py	2007-04-26 17:05:36 UTC (rev 74791)
@@ -1198,11 +1198,19 @@
     def __init__(self, base_version, storage):
         self._storage = storage
         for method in (
-            'getName', 'new_oid', 'modifiedInVersion', 'getSize',
-            'undoLog', 'versionEmpty', 'sortKey', 'loadBefore',
+            'getName', 'new_oid', 'getSize', 'sortKey', 'loadBefore',
             ):
             setattr(self, method, getattr(storage, method))
 
+        try:
+            supportsVersions = storage.supportsVersions
+        except AttributeError:
+            pass
+        else:
+            if supportsVersions():
+                self.modifiedInVersion = storage.modifiedInVersion
+                self.versionEmpty = storage.versionEmpty
+
         self._base_version = base_version
         tmpdir = os.environ.get('ZODB_BLOB_TEMPDIR')
         if tmpdir is None:



More information about the Zodb-checkins mailing list