[Zope3-checkins] CVS: Zope3/src/zope/app/startup - bootstrap.py:1.17

Steve Alexander steve@cat-box.net
Wed, 4 Jun 2003 10:58:28 -0400


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

Modified Files:
	bootstrap.py 
Log Message:
Installed and registered ZopeContainerDecorator.
For new code, it is now unnecessary to adapt a context-wrapped container
to ZopeContainerAdapter. The context-wrapper will do all the correct
wrapping and unwrapping, and will send the correct events.

Existing calls to getAdapter(container, IZopeContainer) are harmless, as
a context-wrapped container provides IZopeContainer. So, the getAdapter
call will simply return the already-wrapped container.
I'll be changing existing code to avoid using ZopeContainerAdapter.



=== Zope3/src/zope/app/startup/bootstrap.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/startup/bootstrap.py:1.16	Wed May 28 11:46:13 2003
+++ Zope3/src/zope/app/startup/bootstrap.py	Wed Jun  4 10:57:57 2003
@@ -33,7 +33,6 @@
 from zope.app.services.event import EventService
 from zope.app.services.errorr import ErrorReportingService
 from zope.app.services.principalannotation import PrincipalAnnotationService
-from zope.app.container.zopecontainer import ZopeContainerAdapter
 from zope.proxy import removeAllProxies
 from zope.app.event import publish
 from zope.app.event.objectevent import ObjectCreatedEvent
@@ -116,8 +115,7 @@
         setattr(service, k, v)
     return name
 
-def configureService(root_folder, service_type, name,
-                     initial_status='Active'):
+def configureService(root_folder, service_type, name, initial_status='Active'):
     """Configure a service in the root folder."""
     package_name = '/++etc++site/default'
     package = traverse(root_folder, package_name)
@@ -125,7 +123,6 @@
     configuration =  ServiceConfiguration(service_type,
                                           package_name + '/' + name,
                                           root_folder)
-    cm = ZopeContainerAdapter(configuration_manager)
-    key = cm.setObject("", configuration)
+    key = configuration_manager.setObject("", configuration)
     configuration = traverseName(configuration_manager, key)
     configuration.status = initial_status