view.py
changeset 9256 697a8181ba30
parent 8976 aeb7d400ee92
child 9492 c7fc56eecd1a
--- a/view.py	Mon Aug 26 16:12:30 2013 +0200
+++ b/view.py	Mon Aug 26 16:14:09 2013 +0200
@@ -558,34 +558,6 @@
     __registry__ = 'adapters'
 
 
-def implements_adapter_compat(iface):
-    def _pre39_compat(func):
-        def decorated(self, *args, **kwargs):
-            entity = self.entity
-            if hasattr(entity, func.__name__):
-                warn('[3.9] %s method is deprecated, define it on a custom '
-                     '%s for %s instead' % (func.__name__, iface,
-                                            entity.__class__),
-                     DeprecationWarning)
-                member = getattr(entity, func.__name__)
-                if callable(member):
-                    return member(*args, **kwargs)
-                return member
-            return func(self, *args, **kwargs)
-        decorated.decorated = func
-        return decorated
-    return _pre39_compat
-
-
-def unwrap_adapter_compat(cls):
-    parent = cls.__bases__[0]
-    for member_name in dir(parent):
-        member = getattr(parent, member_name)
-        if isinstance(member, types.MethodType) and hasattr(member.im_func, 'decorated') and not member_name in cls.__dict__:
-            method = new.instancemethod(member.im_func.decorated, None, cls)
-            setattr(cls, member_name, method)
-
-
 class auto_unwrap_bw_compat(type):
     def __new__(mcs, name, bases, classdict):
         cls = type.__new__(mcs, name, bases, classdict)
@@ -596,7 +568,6 @@
 
 class EntityAdapter(Adapter):
     """base class for entity adapters (eg adapt an entity to an interface)"""
-    __metaclass__ = auto_unwrap_bw_compat
     def __init__(self, _cw, **kwargs):
         try:
             self.entity = kwargs.pop('entity')