[Zope3-checkins] CVS: Zope3/src/zope/app/services - event.py:1.38 field.py:1.11 hub.py:1.32 menu.py:1.11 pagefolder.py:1.21 registration.py:1.23 service.py:1.40 servicecontainer.py:1.9

Jim Fulton jim at zope.com
Fri Mar 5 17:09:48 EST 2004


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

Modified Files:
	event.py field.py hub.py menu.py pagefolder.py registration.py 
	service.py servicecontainer.py 
Log Message:
Renamed interface methods:

isImplementedByInstancesOf to implementedBy
  isImplementedBy            to providedBy


=== Zope3/src/zope/app/services/event.py 1.37 => 1.38 ===
--- Zope3/src/zope/app/services/event.py:1.37	Tue Mar  2 13:51:03 2004
+++ Zope3/src/zope/app/services/event.py	Fri Mar  5 17:09:16 2004
@@ -218,7 +218,7 @@
         #     this mix-in is used as part of a subscriptions service.
         #     The dependences of these mixins need to be documented and
         #     reevaluated.
-        if ISubscriptionService.isImplementedBy(wrapped_self):
+        if ISubscriptionService.providedBy(wrapped_self):
             real_unsubscribeAll = unsubscribeAll
             unsubscribeAll = lambda x: real_unsubscribeAll(x, local_only=True)
 
@@ -413,7 +413,7 @@
             # from our subscriptions list and try to find another event
             # service to which to attach
             clean_subscribable = removeAllProxies(subscribable)
-            if ISubscriptionService.isImplementedBy(
+            if ISubscriptionService.providedBy(
                 removeAllProxies(clean_subscribable)):
                 try:
                     context = zapi.getService(self, EventSubscription)


=== Zope3/src/zope/app/services/field.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/services/field.py:1.10	Fri Jul  4 06:59:16 2003
+++ Zope3/src/zope/app/services/field.py	Fri Mar  5 17:09:16 2004
@@ -45,6 +45,6 @@
         except NotFoundError:
             raise ValidationError("Path for non-existent object", value)
 
-        if not self.type.isImplementedBy(component):
+        if not self.type.providedBy(component):
             raise ValidationError("Wrong component type", value)
 


=== Zope3/src/zope/app/services/hub.py 1.31 => 1.32 ===
--- Zope3/src/zope/app/services/hub.py:1.31	Wed Mar  3 05:38:51 2004
+++ Zope3/src/zope/app/services/hub.py	Fri Mar  5 17:09:16 2004
@@ -216,12 +216,12 @@
         # check whether an IObjectMovedEvent event is a 'moved', 'added', or
         # 'removed'.
         
-        if IObjectMovedEvent.isImplementedBy(event) and \
-            not IObjectAddedEvent.isImplementedBy(event):
+        if IObjectMovedEvent.providedBy(event) and \
+            not IObjectAddedEvent.providedBy(event):
             pathslash = canonicalSlash(event.oldParent, event.oldName)
             hubid = self.__path_to_hubid.get(pathslash)      
             if hubid is not None:
-                if IObjectRemovedEvent.isImplementedBy(event):
+                if IObjectRemovedEvent.providedBy(event):
                     # Removed - update data and publish remove hub event
                     self._removeDescendants(pathslash)
                     event = ObjectRemovedHubEvent(
@@ -238,7 +238,7 @@
                         userPath(new_pathslash), event.object)
                     self._notify(self, event)
 
-        elif IObjectModifiedEvent.isImplementedBy(event):
+        elif IObjectModifiedEvent.providedBy(event):
             # Modified - publish modified hub event
             pathslash = canonicalSlash(zapi.getPath(event.object))
             hubid = self.__path_to_hubid.get(pathslash)
@@ -524,7 +524,7 @@
         # XXX Policy decision: only traverse into folders
         # XXX Ugh! direct dependency on folders
         # Can this be changed to IContentContainer?!?
-        if not IFolder.isImplementedBy(object):
+        if not IFolder.providedBy(object):
             return
         # Register subobjects
         names = object.keys()


=== Zope3/src/zope/app/services/menu.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/services/menu.py:1.10	Tue Mar  2 12:40:52 2004
+++ Zope3/src/zope/app/services/menu.py	Fri Mar  5 17:09:16 2004
@@ -156,7 +156,7 @@
         next = getNextService(self, BrowserMenu)
 
         # Check whether we deal with a Global Menu Service
-        if IGlobalBrowserMenuService.isImplementedBy(next):
+        if IGlobalBrowserMenuService.providedBy(next):
             return next._registry.get(menu_id, default)
 
         return next.queryInheritedMenu(menu_id, True, default)


=== Zope3/src/zope/app/services/pagefolder.py 1.20 => 1.21 ===
--- Zope3/src/zope/app/services/pagefolder.py:1.20	Wed Mar  3 05:38:51 2004
+++ Zope3/src/zope/app/services/pagefolder.py	Fri Mar  5 17:09:16 2004
@@ -125,15 +125,15 @@
 
 
     def __setitem__(self, name, object):
-        if (IRegistrationManager.isImplementedBy(object) or
-            IZPTTemplate.isImplementedBy(object)):
+        if (IRegistrationManager.providedBy(object) or
+            IZPTTemplate.providedBy(object)):
             super(PageFolder, self).__setitem__(name, object)
         else:
             raise TypeError("Can only add templates", object)
 
 
         # If a template is added, we need to configure it too.
-        if IZPTTemplate.isImplementedBy(object):
+        if IZPTTemplate.providedBy(object):
             template = self[name]
             template = getPath(template)
             registration = PageRegistration(


=== Zope3/src/zope/app/services/registration.py 1.22 => 1.23 ===
--- Zope3/src/zope/app/services/registration.py:1.22	Wed Mar  3 05:38:52 2004
+++ Zope3/src/zope/app/services/registration.py	Fri Mar  5 17:09:16 2004
@@ -697,10 +697,10 @@
         """Delete an item, but not if it's the last registration manager
         """
         item = self[name]
-        if interfaces.IRegistrationManager.isImplementedBy(item):
+        if interfaces.IRegistrationManager.providedBy(item):
             # Check to make sure it's not the last one
             if len([i for i in self.values()
-                    if interfaces.IRegistrationManager.isImplementedBy(i)
+                    if interfaces.IRegistrationManager.providedBy(i)
                     ]
                    ) < 2:
                 raise interfaces.NoRegistrationManagerError(
@@ -713,7 +713,7 @@
         # Get the registration manager for this folder
         for name in self:
             item = self[name]
-            if interfaces.IRegistrationManager.isImplementedBy(item):
+            if interfaces.IRegistrationManager.providedBy(item):
                 # We found one. Get it in context
                 return item
         else:
@@ -727,20 +727,20 @@
         manager = self.get(name+'.py')
         if manager is not None:
             # found an item with that name, make sure it's a module(manager):
-            if IModuleManager.isImplementedBy(manager):
+            if IModuleManager.providedBy(manager):
                 return manager.getModule()
 
         # Look for the module in this folder:
         manager = self.get(name)
         if manager is not None:
             # found an item with that name, make sure it's a module(manager):
-            if IModuleManager.isImplementedBy(manager):
+            if IModuleManager.providedBy(manager):
                 return manager.getModule()
 
 
         # See if out container is a RegistrationManagerContainer:
         c = self.__parent__
-        if interfaces.IRegistrationManagerContainer.isImplementedBy(c):
+        if interfaces.IRegistrationManagerContainer.providedBy(c):
             return c.findModule(name)
 
         # Use sys.modules in lieu of module service:


=== Zope3/src/zope/app/services/service.py 1.39 => 1.40 ===
--- Zope3/src/zope/app/services/service.py:1.39	Wed Mar  3 05:38:52 2004
+++ Zope3/src/zope/app/services/service.py	Fri Mar  5 17:09:16 2004
@@ -101,14 +101,14 @@
         """Find set the next service manager
         """
         while True:
-            if IContainmentRoot.isImplementedBy(site):
+            if IContainmentRoot.providedBy(site):
                 # we're the root site, use the global sm
                 self.next = zapi.getServiceManager(None)
                 return
             site = site.__parent__
             if site is None:
                 raise TypeError("Not enough context information")
-            if ISite.isImplementedBy(site):
+            if ISite.providedBy(site):
                 self.next = site.getSiteManager()
                 self.next.addSubsite(self)
                 return
@@ -220,7 +220,7 @@
             package = self[pkg_name]
             for name in package:
                 component = package[name]
-                if type is not None and not type.isImplementedBy(component):
+                if type is not None and not type.providedBy(component):
                     continue
                 if filter is not None and not filter(component):
                     continue
@@ -230,7 +230,7 @@
 
         if all:
             next_service_manager = getNextServiceManager(self)
-            if IComponentManager.isImplementedBy(next_service_manager):
+            if IComponentManager.providedBy(next_service_manager):
                 next_service_manager.queryComponent(type, filter, all)
 
             local += list(all)
@@ -282,7 +282,7 @@
             # Check that the object implements stuff we need
             self.__parent__ = context
             service = self.getComponent()
-            if not ILocalService.isImplementedBy(service):
+            if not ILocalService.providedBy(service):
                 raise TypeError("service %r doesn't implement ILocalService" %
                                 service)
         # Else, this must be a hopeful test invocation
@@ -294,13 +294,13 @@
 
     def activated(self):
         service = self.getComponent()
-        if IBindingAware.isImplementedBy(service):
+        if IBindingAware.providedBy(service):
             service.bound(self.name)
 
 
     def deactivated(self):
         service = self.getComponent()
-        if IBindingAware.isImplementedBy(service):
+        if IBindingAware.providedBy(service):
             service.unbound(self.name)
 
 
@@ -365,5 +365,5 @@
                 del sm._bindings[name]
 
     for item in folder.values():
-        if IPossibleSite.isImplementedBy(item):
+        if IPossibleSite.providedBy(item):
             fixfolder(item)


=== Zope3/src/zope/app/services/servicecontainer.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/services/servicecontainer.py:1.8	Mon Nov  3 23:04:25 2003
+++ Zope3/src/zope/app/services/servicecontainer.py	Fri Mar  5 17:09:16 2004
@@ -46,10 +46,10 @@
             raise ComponentLookupError('no site manager defined')
 
     def setSiteManager(self, sm):
-        if ISite.isImplementedBy(self):
+        if ISite.providedBy(self):
             raise TypeError("Already a site")
 
-        if IServiceService.isImplementedBy(sm):
+        if IServiceService.providedBy(sm):
             self.__sm = sm
             sm.__name__ = '++etc++site'
             sm.__parent__ = self
@@ -65,7 +65,7 @@
         database = event.database
         connection = database.open()
         app = connection.root().get('Application')
-        if app is None or ISite.isImplementedBy(app):
+        if app is None or ISite.providedBy(app):
             # No old data
             return
         print "Fixing up sites that don't implement ISite"
@@ -76,7 +76,7 @@
 fixup = Subscriber(fixup)
 
 def fixfolder(folder):
-    if ISite.isImplementedBy(folder):
+    if ISite.providedBy(folder):
         # No need to do more, the conversion already happened!
         return
     try:
@@ -91,5 +91,5 @@
             )
 
     for item in folder.values():
-        if IPossibleSite.isImplementedBy(item):
+        if IPossibleSite.providedBy(item):
             fixfolder(item)




More information about the Zope3-Checkins mailing list