[Zope3-checkins] CVS: Zope3/src/zope/app/container - constraints.py:1.6 contained.py:1.11 find.py:1.10 ordered.py:1.9

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


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

Modified Files:
	constraints.py contained.py find.py ordered.py 
Log Message:
Renamed interface methods:

isImplementedByInstancesOf to implementedBy
  isImplementedBy            to providedBy


=== Zope3/src/zope/app/container/constraints.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/container/constraints.py:1.5	Wed Mar  3 05:38:39 2004
+++ Zope3/src/zope/app/container/constraints.py	Fri Mar  5 17:08:59 2004
@@ -181,7 +181,7 @@
                 validate(container)
             break
 
-    if not IContainer.isImplementedBy(container):
+    if not IContainer.providedBy(container):
         # If it doesn't implement IContainer, it can't contain stuff.
         raise TypeError(
             _('Container is not a valid Zope container.')
@@ -290,7 +290,7 @@
 
     def __call__(self, container, name, object):
         for iface in self.types:
-            if iface.isImplementedBy(object):
+            if iface.providedBy(object):
                 return
         raise InvalidItemType(container, object, self.types)
 
@@ -333,7 +333,7 @@
 
     def __call__(self, object):
        for iface in self.types:
-           if iface.isImplementedBy(object):
+           if iface.providedBy(object):
                return True
        else:
            raise InvalidContainerType(object, self.types)


=== Zope3/src/zope/app/container/contained.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/container/contained.py:1.10	Wed Mar  3 05:38:39 2004
+++ Zope3/src/zope/app/container/contained.py	Fri Mar  5 17:08:59 2004
@@ -155,7 +155,7 @@
 
     >>> from zope.app.location import Location
     >>> item = Location()
-    >>> IContained.isImplementedBy(item)
+    >>> IContained.providedBy(item)
     0
     >>> x, event = containedEvent(item, container, 'foo')
     >>> x is item
@@ -164,7 +164,7 @@
     1
     >>> item.__name__
     'foo'
-    >>> IContained.isImplementedBy(item)
+    >>> IContained.providedBy(item)
     1
 
     If the object doesn't even implement ILocation, put a
@@ -181,8 +181,8 @@
 
     """
 
-    if not IContained.isImplementedBy(object):
-        if ILocation.isImplementedBy(object):
+    if not IContained.providedBy(object):
+        if ILocation.providedBy(object):
             zope.interface.directlyProvides(object, IContained)
         else:
             object = ContainedProxy(object)
@@ -354,7 +354,7 @@
 
     >>> from zope.app.location import Location
     >>> item = Location()
-    >>> IContained.isImplementedBy(item)
+    >>> IContained.providedBy(item)
     0
     >>> setitem(container, container.__setitem__, u'l', item)
     >>> container[u'l'] is item
@@ -363,7 +363,7 @@
     1
     >>> item.__name__
     u'l'
-    >>> IContained.isImplementedBy(item)
+    >>> IContained.providedBy(item)
     1
 
     We get new added and modification events:
@@ -387,7 +387,7 @@
     1
     >>> item.__name__
     u'i'
-    >>> IContained.isImplementedBy(item)
+    >>> IContained.providedBy(item)
     1
 
     >>> len(getEvents(IObjectAddedEvent))
@@ -743,7 +743,7 @@
         # No old data
         return
 
-    if IRootFolder.isImplementedBy(app):
+    if IRootFolder.providedBy(app):
         # already did fixup
         return
 
@@ -772,7 +772,7 @@
     for name in container:
         ob = container[name]
 
-        if not IContained.isImplementedBy(ob):
+        if not IContained.providedBy(ob):
             # remove the old item and reassign it
             del container[name]
             ob = contained(ob, container, name)
@@ -781,13 +781,13 @@
             ob.__parent__ = container
             ob.__name__ = name
 
-        if IContainer.isImplementedBy(ob):
+        if IContainer.providedBy(ob):
             fixcontainer(ob)
 
-        if IRegistry.isImplementedBy(ob):
+        if IRegistry.providedBy(ob):
             fixregistry(ob)
 
-    if IPossibleSite.isImplementedBy(container):
+    if IPossibleSite.providedBy(container):
         try:
             sm = container.getSiteManager()
         except ComponentLookupError:
@@ -804,7 +804,7 @@
     fixcontainer(sm)
 
 def fixregistry(registry):
-    if INameRegistry.isImplementedBy(registry):
+    if INameRegistry.providedBy(registry):
         for name in registry.listRegistrationNames():
             stack = registry.queryRegistrations(name)
             stack.__parent__ = registry


=== Zope3/src/zope/app/container/find.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/container/find.py:1.9	Wed Mar  3 05:38:39 2004
+++ Zope3/src/zope/app/container/find.py	Fri Mar  5 17:08:59 2004
@@ -56,7 +56,7 @@
             # if we didn't break out of the loop, all filters matched
             result.append(object)
 
-    if not IReadContainer.isImplementedBy(object):
+    if not IReadContainer.providedBy(object):
         return
 
     container = object


=== Zope3/src/zope/app/container/ordered.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/container/ordered.py:1.8	Wed Mar  3 05:38:39 2004
+++ Zope3/src/zope/app/container/ordered.py	Fri Mar  5 17:08:59 2004
@@ -28,7 +28,7 @@
     """ OrderedContainer maintains entries' order as added and moved.
 
     >>> oc = OrderedContainer()
-    >>> int(IOrderedContainer.isImplementedBy(oc))
+    >>> int(IOrderedContainer.providedBy(oc))
     1
     >>> len(oc)
     0




More information about the Zope3-Checkins mailing list