Commit 3c80054a authored by Tres Seaver's avatar Tres Seaver

Replace deprecated class adviser ('zope.interface.implements').

Use instead the decorator ('zope.interface.implementer').
parent bcabef29
......@@ -16,8 +16,8 @@ import zope.interface
import BTrees.Interfaces
@zope.interface.implementer(BTrees.Interfaces.IBTreeFamily)
class _Family(object):
zope.interface.implements(BTrees.Interfaces.IBTreeFamily)
from BTrees import OOBTree as OO
......
......@@ -420,10 +420,10 @@ def checkCurrentSerialInTransaction(self, oid, serial, transaction):
BaseStorage.checkCurrentSerialInTransaction = checkCurrentSerialInTransaction
@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 @@ class TransactionRecord(object):
_extension = property(fset=_ext_set, fget=_ext_get)
@zope.interface.implementer(ZODB.interfaces.IStorageRecordInformation)
class DataRecord(object):
"""Abstract base class for iterator protocol"""
zope.interface.implements(ZODB.interfaces.IStorageRecordInformation)
version = ''
......
......@@ -112,9 +112,9 @@ class IPersistentReference(zope.interface.Interface):
have two references to the same object that are spelled with different
data (for instance, one with a class and one without).'''
@zope.interface.implementer(IPersistentReference)
class PersistentReference(object):
zope.interface.implements(IPersistentReference)
weak = False
oid = database_name = klass = None
......
......@@ -34,7 +34,7 @@ from ZODB.blob import Blob, rename_or_copy_blob, remove_committed_dir
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 @@ def resetCaches():
global global_reset_counter
global_reset_counter += 1
class Connection(ExportImport, object):
"""Connection to ZODB for loading and storing objects."""
implements(IConnection,
@implementer(IConnection,
ISavepointDataManager,
IPersistentDataManager,
ISynchronizer)
class Connection(ExportImport, object):
"""Connection to ZODB for loading and storing objects."""
_code_timestamp = 0
......@@ -1221,9 +1221,9 @@ class Connection(ExportImport, object):
# Savepoint support
#####################################################################
@implementer(IDataManagerSavepoint)
class Savepoint:
implements(IDataManagerSavepoint)
def __init__(self, datamanager, state):
self.datamanager = datamanager
......@@ -1232,10 +1232,10 @@ class Savepoint:
def rollback(self):
self.datamanager._rollback(self.state)
@implementer(IBlobStorage)
class TmpStore:
"""A storage-like thing to support savepoints."""
implements(IBlobStorage)
def __init__(self, storage):
self._storage = storage
......
......@@ -30,7 +30,7 @@ import ZODB.serialize
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 @@ def getTID(at, before):
return before
@implementer(IDatabase)
class DB(object):
"""The Object Database
-------------------
......@@ -359,7 +360,6 @@ class DB(object):
cacheDetailSize, getCacheSize, getHistoricalCacheSize, setCacheSize,
setHistoricalCacheSize
"""
implements(IDatabase)
klass = Connection # Class to use for connections
_activity_monitor = next = previous = None
......
......@@ -32,12 +32,12 @@ import ZODB.POSException
import ZODB.utils
import zope.interface
class DemoStorage(object):
zope.interface.implements(
@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):
......
......@@ -86,14 +86,7 @@ class TempFormatter(FileStorageFormatter):
def __init__(self, afile):
self._file = afile
class FileStorage(
FileStorageFormatter,
ZODB.blob.BlobStorageMixin,
ConflictResolution.ConflictResolvingStorage,
BaseStorage.BaseStorage,
):
zope.interface.implements(
@zope.interface.implementer(
ZODB.interfaces.IStorage,
ZODB.interfaces.IStorageRestoreable,
ZODB.interfaces.IStorageIteration,
......@@ -101,6 +94,13 @@ class FileStorage(
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
......
......@@ -27,12 +27,12 @@ import ZODB.TimeStamp
import ZODB.utils
import zope.interface
class MappingStorage(object):
zope.interface.implements(
@zope.interface.implementer(
ZODB.interfaces.IStorage,
ZODB.interfaces.IStorageIteration,
)
class MappingStorage(object):
def __init__(self, name='MappingStorage'):
self.__name__ = name
......@@ -351,10 +351,10 @@ class TransactionRecord:
del self.data[oid]
return not self.data
@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
......
......@@ -51,10 +51,10 @@ valid_modes = 'r', 'w', 'r+', 'a', 'c'
# via GC in any thread.
@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 @@ class BlobStorageMixin(object):
return self.fshelper.temp_dir
@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)
......
......@@ -25,6 +25,7 @@ import ZODB.interfaces
broken_cache = {}
@zope.interface.implementer(ZODB.interfaces.IBroken)
class Broken(object):
"""Broken object base class
......@@ -96,7 +97,6 @@ class Broken(object):
>>> broken_cache.clear()
"""
zope.interface.implements(ZODB.interfaces.IBroken)
__Broken_state__ = __Broken_initargs__ = None
......
......@@ -21,11 +21,11 @@ import ZODB.utils
import ZODB.POSException
from ZODB.interfaces import IMVCCStorage
from ZODB.MappingStorage import MappingStorage
from zope.interface import implements
from zope.interface import implementer
@implementer(IMVCCStorage)
class MVCCMappingStorage(MappingStorage):
implements(IMVCCStorage)
def __init__(self, name="MVCC Mapping Storage"):
MappingStorage.__init__(self, name=name)
......
......@@ -15,9 +15,9 @@ import ZODB.blob
import ZODB.interfaces
import zope.interface
@zope.interface.implementer(ZODB.interfaces.IStorageWrapper)
class HexStorage(object):
zope.interface.implements(ZODB.interfaces.IStorageWrapper)
copied_methods = (
'close', 'getName', 'getSize', 'history', 'isReadOnly',
......
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