[Zope3-checkins] CVS: Zope3/src/zope/app/services - registration.py:1.27 service.py:1.41

Jim Fulton jim at zope.com
Sat Mar 6 17:07:26 EST 2004


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

Modified Files:
	registration.py service.py 
Log Message:
Got rid of NamedComponentRegistration.


=== Zope3/src/zope/app/services/registration.py 1.26 => 1.27 ===
--- Zope3/src/zope/app/services/registration.py:1.26	Sat Mar  6 15:06:35 2004
+++ Zope3/src/zope/app/services/registration.py	Sat Mar  6 17:07:25 2004
@@ -437,21 +437,6 @@
         if adapter is not None:
             adapter.removeUsage(zapi.getPath(self))
 
-class NamedComponentRegistration(ComponentRegistration):
-    """Registrations for named components.
-
-    This configures components that live in folders, by name.
-    """
-    implements(interfaces.INamedComponentRegistration)
-
-    def __init__(self, name, component_path, permission=None):
-        self.name = name
-        ComponentRegistration.__init__(self, component_path, permission)
-
-    def usageSummary(self):
-        return "%s %s" % (self.name, self.__class__.__name__)
-
-
 
 class NameRegistry:
     """Mixin for implementing INameRegistry


=== Zope3/src/zope/app/services/service.py 1.40 => 1.41 ===
--- Zope3/src/zope/app/services/service.py:1.40	Fri Mar  5 17:09:16 2004
+++ Zope3/src/zope/app/services/service.py	Sat Mar  6 17:07:25 2004
@@ -55,7 +55,7 @@
 from zope.app.interfaces.services.service import ISiteManager
 
 from zope.app.services.registration import NameComponentRegistry
-from zope.app.services.registration import NamedComponentRegistration
+from zope.app.services.registration import ComponentRegistration
 from zope.app.services.folder import SiteManagementFolder
 from zope.app.interfaces.services.service import ILocalService
 
@@ -266,25 +266,28 @@
 
 ServiceManager = SiteManager # Backward compat
 
-class ServiceRegistration(NamedComponentRegistration):
+class ServiceRegistration(ComponentRegistration):
+    """Registrations for named components.
 
-    __doc__ = IServiceRegistration.__doc__
+    This configures components that live in folders, by name.
+    """
 
-    zope.interface.implements(IServiceRegistration)
-
-    serviceType = 'Services'
+    serviceType = zapi.servicenames.Services
 
-    label = "Service"
+    zope.interface.implements(IServiceRegistration)
 
     def __init__(self, name, path, context=None):
-        super(ServiceRegistration, self).__init__(name, path)
+        ComponentRegistration.__init__(self, path, None)
+        self.name = name
+
         if context is not None:
             # Check that the object implements stuff we need
             self.__parent__ = context
             service = self.getComponent()
             if not ILocalService.providedBy(service):
-                raise TypeError("service %r doesn't implement ILocalService" %
-                                service)
+                raise TypeError(
+                    "service %r doesn't implement ILocalService" %
+                    service)
         # Else, this must be a hopeful test invocation
 
     def getInterface(self):




More information about the Zope3-Checkins mailing list