[Zope3-checkins] CVS: Zope3/src/zope/app/component - classfactory.py:1.4 contentdirective.py:1.2 globalinterfaceservice.py:1.11 interfacefield.py:1.9

Steve Alexander steve@cat-box.net
Sat, 7 Jun 2003 02:37:52 -0400


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

Modified Files:
	classfactory.py contentdirective.py globalinterfaceservice.py 
	interfacefield.py 
Log Message:
updated to use new-style interface declarations


=== Zope3/src/zope/app/component/classfactory.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/component/classfactory.py:1.3	Sat May  3 12:32:41 2003
+++ Zope3/src/zope/app/component/classfactory.py	Sat Jun  7 02:37:21 2003
@@ -13,7 +13,7 @@
 ##############################################################################
 "$Id$"
 
-from zope.interface import implements
+from zope.interface import implements, implementedBy
 from zope.component.interfaces import IFactory
 
 class ClassFactory:
@@ -28,6 +28,6 @@
         return self._class(*args, **kwargs)
 
     def getInterfaces(self):
-        return getattr(self._class, '__implements__', None)
+        return tuple(implementedBy(self._class))
 
 __doc__ = "%s\n\n%s" % (ClassFactory.__doc__, __doc__)


=== Zope3/src/zope/app/component/contentdirective.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/component/contentdirective.py:1.1	Mon May 12 12:32:39 2003
+++ Zope3/src/zope/app/component/contentdirective.py	Sat Jun  7 02:37:21 2003
@@ -17,7 +17,7 @@
 """
 from zope.interface import classProvides
 from types import ModuleType
-from zope.interface.implements import implements
+from zope.interface import implements, classImplements
 from zope.configuration.interfaces import INonEmptyDirective
 from zope.configuration.interfaces import ISubdirectiveHandler
 from zope.component import getService
@@ -51,7 +51,7 @@
 class ContentDirective:
 
     classProvides(INonEmptyDirective)
-    __implements__ = ISubdirectiveHandler
+    implements(ISubdirectiveHandler)
 
     def __init__(self, _context, class_):
         self.__id = class_
@@ -70,11 +70,10 @@
             resolved_interface = resolveInterface(_context, interface)
             r += [
                 Action(
-                    discriminator = ('ContentDirective', self.__class, object()),
-                    callable = implements,
-                    # the last argument is check=1, which causes implements
-                    # to verify that the class does implement the interface
-                    args = (self.__class, resolved_interface, 1),
+                    discriminator = (
+                        'ContentDirective', self.__class, object()),
+                    callable = classImplements,
+                    args = (self.__class, resolved_interface),
                     ),
                 Action(
                    discriminator = None,


=== Zope3/src/zope/app/component/globalinterfaceservice.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/component/globalinterfaceservice.py:1.10	Tue May 20 15:43:25 2003
+++ Zope3/src/zope/app/component/globalinterfaceservice.py	Sat Jun  7 02:37:21 2003
@@ -19,9 +19,10 @@
 
 from zope.component.exceptions import ComponentLookupError
 from zope.app.interfaces.component import IGlobalInterfaceService
+from zope.interface import implements
 
 class InterfaceService:
-    __implements__ = IGlobalInterfaceService
+    implements(IGlobalInterfaceService)
 
     def __init__(self, data=None):
         if data is None:


=== Zope3/src/zope/app/component/interfacefield.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/component/interfacefield.py:1.8	Tue May 13 13:08:33 2003
+++ Zope3/src/zope/app/component/interfacefield.py	Sat Jun  7 02:37:21 2003
@@ -16,14 +16,14 @@
 """
 
 from zope.schema import Enumerated, Field, Tuple
-from zope.interface import Interface
+from zope.interface import Interface, implements
 from zope.interface.interfaces import IInterface
 from zope.schema.interfaces import ValidationError
 from zope.app.interfaces.component import IInterfaceField, IInterfacesField
 
 class InterfaceField(Enumerated, Field):
     __doc__ = IInterfaceField.__doc__
-    __implements__ = IInterfaceField
+    implements(IInterfaceField)
 
     # This is the most base basetype.
     # This isn't the default value. See the 'basetype' arg of __init__ for
@@ -56,7 +56,7 @@
 
 class InterfacesField(Tuple):
     __doc__ = IInterfacesField.__doc__
-    __implements__ = IInterfacesField
+    implements(IInterfacesField)
 
     # This is the most base basetype.
     # This isn't the default value. See the 'basetype' arg of __init__ for