[Zope3-checkins] CVS: Zope3/src/zope/app - attributeannotations.py:1.6 copypastemove.py:1.9 dependable.py:1.4 introspector.py:1.7

Steve Alexander steve@cat-box.net
Tue, 3 Jun 2003 11:33:56 -0400


Update of /cvs-repository/Zope3/src/zope/app
In directory cvs.zope.org:/tmp/cvs-serv7518/src/zope/app

Modified Files:
	attributeannotations.py copypastemove.py dependable.py 
	introspector.py 
Log Message:
new implements() style


=== Zope3/src/zope/app/attributeannotations.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/attributeannotations.py:1.5	Sun Jun  1 11:59:25 2003
+++ Zope3/src/zope/app/attributeannotations.py	Tue Jun  3 11:33:55 2003
@@ -20,14 +20,14 @@
 from zope.app.interfaces.annotation import IAnnotations
 from zope.proxy import removeAllProxies
 from zope.app.context import ContextWrapper
+from zope.interface import implements
 
 class AttributeAnnotations:
     """
     Store annotations in the __annotations__ attribute on a
     IAttributeAnnotatable object.
     """
-
-    __implements__ = IAnnotations
+    implements(IAnnotations)
 
     def __init__(self, obj):
         # We could remove all proxies from obj at this point, but


=== Zope3/src/zope/app/copypastemove.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/copypastemove.py:1.8	Wed May 28 11:45:58 2003
+++ Zope3/src/zope/app/copypastemove.py	Tue Jun  3 11:33:55 2003
@@ -33,11 +33,12 @@
 from zope.app.event.objectevent import ObjectMovedEvent, ObjectCopiedEvent
 from zope.app.event import publish
 from zope.proxy import removeAllProxies
+from zope.interface import implements
 
 class ObjectMover:
     '''Use getAdapter(obj, IObjectMover) to move an object somewhere.'''
 
-    __implements__ = IObjectMover
+    implements(IObjectMover)
 
     def __init__(self, object):
         self.context = object
@@ -101,7 +102,7 @@
 
 class ObjectCopier:
 
-    __implements__ = IObjectCopier
+    implements(IObjectCopier)
 
     def __init__(self, object):
         self.context = object
@@ -165,7 +166,7 @@
 
 class NoChildrenObjectCopier(ObjectCopier):
 
-    __implements__ = INoChildrenObjectCopier
+    implements(INoChildrenObjectCopier)
 
     def __init__(self, object):
         self.context = object


=== Zope3/src/zope/app/dependable.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/dependable.py:1.3	Mon Dec 30 16:41:41 2002
+++ Zope3/src/zope/app/dependable.py	Tue Jun  3 11:33:55 2003
@@ -20,13 +20,14 @@
 from zope.app.interfaces.dependable import IDependable
 from zope.app.interfaces.annotation import IAnnotations
 from zope.component import getAdapter
+from zope.interface import implements
 
 key = 'zope.app.dependable.Dependents'
 
 class Dependable:
     __doc__ = IDependable.__doc__
 
-    __implements__ =  IDependable
+    implements(IDependable)
 
     def __init__(self, context):
         self.context = context


=== Zope3/src/zope/app/introspector.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/introspector.py:1.6	Wed May 28 11:45:58 2003
+++ Zope3/src/zope/app/introspector.py	Tue Jun  3 11:33:55 2003
@@ -16,15 +16,15 @@
 
 from zope.app.interfaces.introspector import IIntrospector
 from zope.app.interfaces.services.module import IModuleService
-from zope.component import getServiceManager, getAdapter, \
-     getServiceDefinitions
+from zope.component import getServiceManager, getAdapter, getServiceDefinitions
 from zope.proxy import removeAllProxies
+from zope.interface import implements, implementedBy
 
 
 class Introspector:
     """Introspects an object"""
 
-    __implements__ = IIntrospector
+    implements(IIntrospector)
 
     def __init__(self, context):
         self.context = context
@@ -91,12 +91,7 @@
 
     def getInterfaces(self):
         """Returns interfaces implemented by this class"""
-        interfaces = removeAllProxies(self.currentclass).__implements__
-        if type(interfaces) != tuple:
-            interfaces = (interfaces,)
-        else:
-            interfaces = self._unpackTuple(interfaces)
-        return interfaces
+        return tuple(implementedBy(removeAllProxies(self.currentclass)))
 
     def getInterfaceNames(self):
         names = []