[Zodb-checkins] SVN: ZODB/trunk/src/ Replace deprecated class adviser ('zope.interface.implements').

Tres Seaver cvs-admin at zope.org
Thu May 17 04:33:11 UTC 2012


Log message for revision 125960:
  Replace deprecated class adviser ('zope.interface.implements').
  
  Use instead the decorator ('zope.interface.implementer').

Changed:
  U   ZODB/trunk/src/BTrees/__init__.py
  U   ZODB/trunk/src/ZODB/BaseStorage.py
  U   ZODB/trunk/src/ZODB/ConflictResolution.py
  U   ZODB/trunk/src/ZODB/Connection.py
  U   ZODB/trunk/src/ZODB/DB.py
  U   ZODB/trunk/src/ZODB/DemoStorage.py
  U   ZODB/trunk/src/ZODB/FileStorage/FileStorage.py
  U   ZODB/trunk/src/ZODB/MappingStorage.py
  U   ZODB/trunk/src/ZODB/blob.py
  U   ZODB/trunk/src/ZODB/broken.py
  U   ZODB/trunk/src/ZODB/tests/MVCCMappingStorage.py
  U   ZODB/trunk/src/ZODB/tests/hexstorage.py

-=-
Modified: ZODB/trunk/src/BTrees/__init__.py
===================================================================
--- ZODB/trunk/src/BTrees/__init__.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/BTrees/__init__.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -16,8 +16,8 @@
 import BTrees.Interfaces
 
 
+ at zope.interface.implementer(BTrees.Interfaces.IBTreeFamily)
 class _Family(object):
-    zope.interface.implements(BTrees.Interfaces.IBTreeFamily)
 
     from BTrees import OOBTree as OO
 

Modified: ZODB/trunk/src/ZODB/BaseStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/BaseStorage.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/BaseStorage.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -420,10 +420,10 @@
 
 BaseStorage.checkCurrentSerialInTransaction = checkCurrentSerialInTransaction
 
+ at zope.interface.implementer(ZODB.interfaces.IStorageTransactionInformation)
 class TransactionRecord(object):
     """Abstract base class for iterator protocol"""
 
-    zope.interface.implements(ZODB.interfaces.IStorageTransactionInformation)
 
     def __init__(self, tid, status, user, description, extension):
         self.tid = tid
@@ -441,10 +441,10 @@
     _extension = property(fset=_ext_set, fget=_ext_get)
 
 
+ at zope.interface.implementer(ZODB.interfaces.IStorageRecordInformation)
 class DataRecord(object):
     """Abstract base class for iterator protocol"""
 
-    zope.interface.implements(ZODB.interfaces.IStorageRecordInformation)
 
     version = ''
 

Modified: ZODB/trunk/src/ZODB/ConflictResolution.py
===================================================================
--- ZODB/trunk/src/ZODB/ConflictResolution.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/ConflictResolution.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -112,9 +112,9 @@
         have two references to the same object that are spelled with different
         data (for instance, one with a class and one without).'''
 
+ at zope.interface.implementer(IPersistentReference)
 class PersistentReference(object):
 
-    zope.interface.implements(IPersistentReference)
 
     weak = False
     oid = database_name = klass = None

Modified: ZODB/trunk/src/ZODB/Connection.py
===================================================================
--- ZODB/trunk/src/ZODB/Connection.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/Connection.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -34,7 +34,7 @@
 from transaction.interfaces import ISavepointDataManager
 from transaction.interfaces import IDataManagerSavepoint
 from transaction.interfaces import ISynchronizer
-from zope.interface import implements
+from zope.interface import implementer
 
 import transaction
 
@@ -66,13 +66,13 @@
     global global_reset_counter
     global_reset_counter += 1
 
+ at implementer(IConnection,
+             ISavepointDataManager,
+             IPersistentDataManager,
+             ISynchronizer)
 class Connection(ExportImport, object):
     """Connection to ZODB for loading and storing objects."""
 
-    implements(IConnection,
-               ISavepointDataManager,
-               IPersistentDataManager,
-               ISynchronizer)
 
 
     _code_timestamp = 0
@@ -1221,9 +1221,9 @@
     # Savepoint support
     #####################################################################
 
+ at implementer(IDataManagerSavepoint)
 class Savepoint:
 
-    implements(IDataManagerSavepoint)
 
     def __init__(self, datamanager, state):
         self.datamanager = datamanager
@@ -1232,10 +1232,10 @@
     def rollback(self):
         self.datamanager._rollback(self.state)
 
+ at implementer(IBlobStorage)
 class TmpStore:
     """A storage-like thing to support savepoints."""
 
-    implements(IBlobStorage)
 
     def __init__(self, storage):
         self._storage = storage

Modified: ZODB/trunk/src/ZODB/DB.py
===================================================================
--- ZODB/trunk/src/ZODB/DB.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/DB.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -30,7 +30,7 @@
 
 import transaction.weakset
 
-from zope.interface import implements
+from zope.interface import implementer
 from ZODB.interfaces import IDatabase
 from ZODB.interfaces import IMVCCStorage
 
@@ -319,6 +319,7 @@
     return before
 
 
+ at implementer(IDatabase)
 class DB(object):
     """The Object Database
     -------------------
@@ -359,7 +360,6 @@
         cacheDetailSize, getCacheSize, getHistoricalCacheSize, setCacheSize,
         setHistoricalCacheSize
     """
-    implements(IDatabase)
 
     klass = Connection  # Class to use for connections
     _activity_monitor = next = previous = None

Modified: ZODB/trunk/src/ZODB/DemoStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/DemoStorage.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/DemoStorage.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -32,13 +32,13 @@
 import ZODB.utils
 import zope.interface
 
-class DemoStorage(object):
-
-    zope.interface.implements(
+ at zope.interface.implementer(
         ZODB.interfaces.IStorage,
         ZODB.interfaces.IStorageIteration,
         )
+class DemoStorage(object):
 
+
     def __init__(self, name=None, base=None, changes=None,
                  close_base_on_close=None, close_changes_on_close=None):
 

Modified: ZODB/trunk/src/ZODB/FileStorage/FileStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/FileStorage/FileStorage.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/FileStorage/FileStorage.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -86,14 +86,7 @@
     def __init__(self, afile):
         self._file = afile
 
-class FileStorage(
-    FileStorageFormatter,
-    ZODB.blob.BlobStorageMixin,
-    ConflictResolution.ConflictResolvingStorage,
-    BaseStorage.BaseStorage,
-    ):
-
-    zope.interface.implements(
+ at zope.interface.implementer(
         ZODB.interfaces.IStorage,
         ZODB.interfaces.IStorageRestoreable,
         ZODB.interfaces.IStorageIteration,
@@ -101,7 +94,14 @@
         ZODB.interfaces.IStorageCurrentRecordIteration,
         ZODB.interfaces.IExternalGC,
         )
+class FileStorage(
+    FileStorageFormatter,
+    ZODB.blob.BlobStorageMixin,
+    ConflictResolution.ConflictResolvingStorage,
+    BaseStorage.BaseStorage,
+    ):
 
+
     # Set True while a pack is in progress; undo is blocked for the duration.
     _pack_is_in_progress = False
 

Modified: ZODB/trunk/src/ZODB/MappingStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/MappingStorage.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/MappingStorage.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -27,12 +27,12 @@
 import ZODB.utils
 import zope.interface
 
-class MappingStorage(object):
 
-    zope.interface.implements(
+ at zope.interface.implementer(
         ZODB.interfaces.IStorage,
         ZODB.interfaces.IStorageIteration,
         )
+class MappingStorage(object):
 
     def __init__(self, name='MappingStorage'):
         self.__name__ = name
@@ -351,10 +351,10 @@
         del self.data[oid]
         return not self.data
 
+ at zope.interface.implementer(ZODB.interfaces.IStorageRecordInformation)
 class DataRecord(object):
     """Abstract base class for iterator protocol"""
 
-    zope.interface.implements(ZODB.interfaces.IStorageRecordInformation)
 
     version = ''
     data_txn = None

Modified: ZODB/trunk/src/ZODB/blob.py
===================================================================
--- ZODB/trunk/src/ZODB/blob.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/blob.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -51,10 +51,10 @@
 # via GC in any thread.
 
 
+ at zope.interface.implementer(ZODB.interfaces.IBlob)
 class Blob(persistent.Persistent):
     """A BLOB supports efficient handling of large data within ZODB."""
 
-    zope.interface.implements(ZODB.interfaces.IBlob)
 
     _p_blob_uncommitted = None  # Filename of the uncommitted (dirty) data
     _p_blob_committed = None    # Filename of the committed data
@@ -686,11 +686,11 @@
         return self.fshelper.temp_dir
 
 
+ at zope.interface.implementer(ZODB.interfaces.IBlobStorage)
 class BlobStorage(BlobStorageMixin):
     """A wrapper/proxy storage to support blobs.
     """
 
-    zope.interface.implements(ZODB.interfaces.IBlobStorage)
 
     def __init__(self, base_directory, storage, layout='automatic'):
         assert not ZODB.interfaces.IBlobStorage.providedBy(storage)

Modified: ZODB/trunk/src/ZODB/broken.py
===================================================================
--- ZODB/trunk/src/ZODB/broken.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/broken.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -25,6 +25,7 @@
 
 broken_cache = {}
 
+ at zope.interface.implementer(ZODB.interfaces.IBroken)
 class Broken(object):
     """Broken object base class
 
@@ -96,7 +97,6 @@
          >>> broken_cache.clear()
        """
 
-    zope.interface.implements(ZODB.interfaces.IBroken)
 
     __Broken_state__ = __Broken_initargs__ = None
 

Modified: ZODB/trunk/src/ZODB/tests/MVCCMappingStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/MVCCMappingStorage.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/tests/MVCCMappingStorage.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -21,11 +21,11 @@
 import ZODB.POSException
 from ZODB.interfaces import IMVCCStorage
 from ZODB.MappingStorage import MappingStorage
-from zope.interface import implements
+from zope.interface import implementer
 
 
+ at implementer(IMVCCStorage)
 class MVCCMappingStorage(MappingStorage):
-    implements(IMVCCStorage)
 
     def __init__(self, name="MVCC Mapping Storage"):
         MappingStorage.__init__(self, name=name)

Modified: ZODB/trunk/src/ZODB/tests/hexstorage.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/hexstorage.py	2012-05-17 04:01:08 UTC (rev 125959)
+++ ZODB/trunk/src/ZODB/tests/hexstorage.py	2012-05-17 04:33:07 UTC (rev 125960)
@@ -15,9 +15,9 @@
 import ZODB.interfaces
 import zope.interface
 
+ at zope.interface.implementer(ZODB.interfaces.IStorageWrapper)
 class HexStorage(object):
 
-    zope.interface.implements(ZODB.interfaces.IStorageWrapper)
 
     copied_methods = (
             'close', 'getName', 'getSize', 'history', 'isReadOnly',



More information about the Zodb-checkins mailing list