[Zope3-checkins] CVS: Zope3/src/zope/app/component - contentdirective.py:1.15 hooks.py:1.18 interface.py:1.2 interfacefield.py:1.12 nextservice.py:1.9

Jim Fulton jim at zope.com
Fri Mar 5 17:10:00 EST 2004


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

Modified Files:
	contentdirective.py hooks.py interface.py interfacefield.py 
	nextservice.py 
Log Message:
Renamed interface methods:

isImplementedByInstancesOf to implementedBy
  isImplementedBy            to providedBy


=== Zope3/src/zope/app/component/contentdirective.py 1.14 => 1.15 ===
--- Zope3/src/zope/app/component/contentdirective.py:1.14	Fri Mar  5 10:51:44 2004
+++ Zope3/src/zope/app/component/contentdirective.py	Fri Mar  5 17:08:58 2004
@@ -154,7 +154,7 @@
         _context = self.__context
         for name in schema:
             field = schema[name]
-            if IField.isImplementedBy(field) and not field.readonly:
+            if IField.providedBy(field) and not field.readonly:
                 _context.action(
                     discriminator = ('protectSetAttribute', self.__class, name),
                     callable = protectSetAttribute,


=== Zope3/src/zope/app/component/hooks.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/component/hooks.py:1.17	Tue Mar  2 12:51:50 2004
+++ Zope3/src/zope/app/component/hooks.py	Fri Mar  5 17:08:58 2004
@@ -36,10 +36,10 @@
     clean_context = removeAllProxies(context)
 
     # if the context is actually a service or site manager...
-    if IServiceService.isImplementedBy(clean_context):
+    if IServiceService.providedBy(clean_context):
         return trustedRemoveSecurityProxy(context)
 
-    elif (ISite.isImplementedBy(clean_context)):
+    elif (ISite.providedBy(clean_context)):
         return trustedRemoveSecurityProxy(context.getSiteManager())
     else:
         container = getattr(context, '__parent__', None)
@@ -47,7 +47,7 @@
             if local:
                 # Check to make sure that when we run out of context, we
                 # have a root object:
-                if not IContainmentRoot.isImplementedBy(context):
+                if not IContainmentRoot.providedBy(context):
                     raise TypeError("Not enough context to get next "
                                     "site manager")
 
@@ -68,7 +68,7 @@
     views = getService(context, Presentation)
     view = views.queryView(object, name, request, default=default,
                            providing=providing)
-    if ILocation.isImplementedBy(view):
+    if ILocation.providedBy(view):
         locate(view, object, name)
 
     return view


=== Zope3/src/zope/app/component/interface.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/component/interface.py:1.1	Fri Mar  5 10:52:57 2004
+++ Zope3/src/zope/app/component/interface.py	Fri Mar  5 17:08:58 2004
@@ -35,15 +35,15 @@
     >>> from zope.app.content.interfaces import IContentType
     >>> class I(Interface):
     ...     pass
-    >>> IInterface.isImplementedBy(I)
+    >>> IInterface.providedBy(I)
     True
-    >>> IContentType.isImplementedBy(I)
+    >>> IContentType.providedBy(I)
     False
     >>> interfaces = utilities.getUtilitiesFor(IContentType)
     >>> interfaces
     []
     >>> provideInterface('', I, IContentType)
-    >>> IContentType.isImplementedBy(I)
+    >>> IContentType.providedBy(I)
     True
     >>> interfaces = utilities.getUtilitiesFor(IContentType)
     >>> [name for (name, iface) in interfaces]
@@ -53,9 +53,9 @@
     >>> class I1(Interface):
     ...     pass
     >>> provideInterface('', I1)
-    >>> IInterface.isImplementedBy(I1)
+    >>> IInterface.providedBy(I1)
     True
-    >>> IContentType.isImplementedBy(I1)
+    >>> IContentType.providedBy(I1)
     False
     >>> interfaces1 = utilities.getUtilitiesFor(IContentType)
     >>> [name for (name, iface) in interfaces]
@@ -68,7 +68,7 @@
     if not id:
         id = "%s.%s" % (interface.__module__, interface.__name__)
 
-    if not IInterface.isImplementedBy(interface):
+    if not IInterface.providedBy(interface):
         if not isinstance(interface, (type, ClassType)):
             raise TypeError(id, "is not an interface or class")
         return
@@ -95,16 +95,16 @@
     >>> from zope.app.content.interfaces import IContentType
     >>> class I4(Interface):
     ...     pass
-    >>> IInterface.isImplementedBy(I4)
+    >>> IInterface.providedBy(I4)
     True
-    >>> IContentType.isImplementedBy(I4)
+    >>> IContentType.providedBy(I4)
     False
     >>> getInterface(None, 'zope.app.component.interface.I4')
     Traceback (most recent call last):
     ...
     ComponentLookupError: zope.app.component.interface.I4
     >>> provideInterface('', I4, IContentType)
-    >>> IContentType.isImplementedBy(I4)
+    >>> IContentType.providedBy(I4)
     True
     >>> iface = queryInterface( """\
                 """ 'zope.app.component.interface.I4')
@@ -130,14 +130,14 @@
     >>> from zope.app.content.interfaces import IContentType
     >>> class I3(Interface):
     ...     pass
-    >>> IInterface.isImplementedBy(I3)
+    >>> IInterface.providedBy(I3)
     True
-    >>> IContentType.isImplementedBy(I3)
+    >>> IContentType.providedBy(I3)
     False
     >>> queryInterface('zope.app.component.interface.I3')
     
     >>> provideInterface('', I3, IContentType)
-    >>> IContentType.isImplementedBy(I3)
+    >>> IContentType.providedBy(I3)
     True
     >>> iface = queryInterface('zope.app.component.interface.I3')
     >>> iface.__name__
@@ -159,14 +159,14 @@
     >>> from zope.app.content.interfaces import IContentType
     >>> class I5(Interface):
     ...     pass
-    >>> IInterface.isImplementedBy(I5)
+    >>> IInterface.providedBy(I5)
     True
-    >>> IContentType.isImplementedBy(I5)
+    >>> IContentType.providedBy(I5)
     False
     >>> searchInterface(None, 'zope.app.component.interface.I5')
     []
     >>> provideInterface('', I5, IContentType)
-    >>> IContentType.isImplementedBy(I5)
+    >>> IContentType.providedBy(I5)
     True
     >>> iface = searchInterface(None,
     ...                        'zope.app.component.interface.I5')
@@ -192,14 +192,14 @@
     >>> from zope.app.content.interfaces import IContentType
     >>> class I5(Interface):
     ...     pass
-    >>> IInterface.isImplementedBy(I5)
+    >>> IInterface.providedBy(I5)
     True
-    >>> IContentType.isImplementedBy(I5)
+    >>> IContentType.providedBy(I5)
     False
     >>> searchInterface(None, 'zope.app.component.interface.I5')
     []
     >>> provideInterface('', I5, IContentType)
-    >>> IContentType.isImplementedBy(I5)
+    >>> IContentType.providedBy(I5)
     True
     >>> iface = searchInterfaceIds(None,
     ...                        'zope.app.component.interface.I5')
@@ -236,7 +236,7 @@
     docs = [str(iface_id).lower(),
             str(interface.__doc__).lower()]
 
-    if IInterface.isImplementedBy(interface):
+    if IInterface.providedBy(interface):
         for name in interface:
             docs.append(
                 str(interface.getDescriptionFor(name).__doc__).lower())


=== Zope3/src/zope/app/component/interfacefield.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/component/interfacefield.py:1.11	Tue Dec 16 05:32:05 2003
+++ Zope3/src/zope/app/component/interfacefield.py	Fri Mar  5 17:08:58 2004
@@ -48,7 +48,7 @@
         if basetype is None:
             basetype = Interface
 
-        if not IInterface.isImplementedBy(value):
+        if not IInterface.providedBy(value):
             raise ValidationError("Not an interface", value)
 
         if not value.extends(basetype, False):
@@ -84,7 +84,7 @@
             if item is None and none_ok:
                 continue
 
-            if not IInterface.isImplementedBy(item):
+            if not IInterface.providedBy(item):
                 raise ValidationError("Not an interface", item)
 
             if not item.extends(basetype, 0):


=== Zope3/src/zope/app/component/nextservice.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/component/nextservice.py:1.8	Sun Sep 21 13:31:26 2003
+++ Zope3/src/zope/app/component/nextservice.py	Fri Mar  5 17:08:58 2004
@@ -62,7 +62,7 @@
 
     # But we're *really* paranoid, so we'll double check.
     while ((container is not None) and not
-           ISite.isImplementedBy(removeAllProxies(container))
+           ISite.providedBy(removeAllProxies(container))
            ):
         container = container.__parent__ # we should be
 




More information about the Zope3-Checkins mailing list