[Zope3-checkins] CVS: Zope3/src/zope/app/process - bootstrap.py:1.12

Anthony Baxter anthony at interlink.com.au
Sat Feb 7 02:21:56 EST 2004


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

Modified Files:
	bootstrap.py 
Log Message:
SiteManager objects implemented their own name selection code. This
has been replaced with the standard NameChooser code. A shallow 
difference is that while services were created as ServiceName-1,
ServiceName-2, ..., they're now ServiceName, ServiceName-2, 
ServiceName-3. 


=== Zope3/src/zope/app/process/bootstrap.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/process/bootstrap.py:1.11	Sat Feb  7 01:51:13 2004
+++ Zope3/src/zope/app/process/bootstrap.py	Sat Feb  7 02:21:26 2004
@@ -41,6 +41,7 @@
 from zope.app.event import function
 from zope.component.exceptions import ComponentLookupError
 from zope.app.interfaces.services.hub import ISubscriptionControl
+from zope.app.interfaces.container import INameChooser
 
 class BootstrapSubscriberBase:
     """A startup event subscriber base class.
@@ -95,7 +96,7 @@
                           if object_type.isImplementedBy(package[name]) ]
         if valid_objects:
             return None
-        name = object_name + '-1'
+        name = object_name 
         obj = object_factory()
         obj = removeAllProxies(obj)
         package[name] = obj
@@ -197,9 +198,10 @@
     # calls at the end require a fully context-wrapped
     # registration; hence all the traverse() and traverseName() calls.
     package = getServiceManagerDefault(root_folder)
-    name = service_type + '-1'
+    chooser = zapi.getAdapter(package, INameChooser)
     service = service_factory()
     service = removeAllProxies(service)
+    name = chooser.chooseName(service_type, service)
     package[name] = service
 
     # Set additional attributes on the service




More information about the Zope3-Checkins mailing list