[Zodb-checkins] SVN: ZODB/branches/jim-storage-api-cleanup/src/ZODB/Blobs/BlobStorage.py Removed undo and version support.

Jim Fulton jim at zope.com
Thu Apr 26 15:35:45 EDT 2007


Log message for revision 74814:
  Removed undo and version support.
  
  Removed empty close and cleanup implementations.  They tend to encourage
  to broken implementations (that should have provided them).
  
  Made _begin, _abort, _vote, and _finish passes again, since some
  storages use these implementations.
  
  Updated loadSerial to work with storages that don't support versions
  and renamed to getTid.
  
  Reduced loadBefore to an empty method.  This produces the same output
  as before. :)  There was an elaborate implementation that only worked
  with an implementation that didn't need it. :)
  
  Removed getExtensionMethods, which is not part of the storage API.
  
  Created a copy *function* from copyTransactionsFrom. Now
  copyTransactionsFrom just uses that.
  

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

-=-
Modified: ZODB/branches/jim-storage-api-cleanup/src/ZODB/Blobs/BlobStorage.py
===================================================================
--- ZODB/branches/jim-storage-api-cleanup/src/ZODB/Blobs/BlobStorage.py	2007-04-26 19:35:41 UTC (rev 74813)
+++ ZODB/branches/jim-storage-api-cleanup/src/ZODB/Blobs/BlobStorage.py	2007-04-26 19:35:44 UTC (rev 74814)
@@ -41,7 +41,7 @@
 
     # Proxies can't have a __dict__ so specifying __slots__ here allows
     # us to have instance attributes explicitly on the proxy.
-    __slots__ = ('fshelper', 'dirty_oids')
+    __slots__ = ('fshelper', 'dirty_oids', '_BlobStorage__supportsUndo')
 
     def __new__(self, base_directory, storage):
         return SpecificationDecoratorBase.__new__(self, storage)
@@ -53,6 +53,13 @@
         self.fshelper.create()
         self.fshelper.checkSecure()
         self.dirty_oids = []
+        try:
+            supportsUndo = storage.supportsUndo
+        except AttributeError:
+            supportsUndo = False
+        else:
+            supportsUndo = supportsUndo()
+        self.__supportsUndo = supportsUndo
 
     @non_overridable
     def __repr__(self):
@@ -184,7 +191,7 @@
         # perform a pack on blob data
         self._lock_acquire()
         try:
-            if unproxied.supportsUndo():
+            if self.__supportsUndo:
                 self._packUndoing(packtime, referencesf)
             else:
                 self._packNonUndoing(packtime, referencesf)



More information about the Zodb-checkins mailing list