[Zope3-checkins] CVS: Zope3/src/zope/app - _app.py:1.14.2.4
Philipp von Weitershausen
philikon at philikon.de
Fri Aug 8 11:44:23 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app
In directory cvs.zope.org:/tmp/cvs-serv1795
Modified Files:
Tag: zcml-interface-field-branch
_app.py
Log Message:
Bootstrap the interface service in _app.
=== Zope3/src/zope/app/_app.py 1.14.2.3 => 1.14.2.4 ===
--- Zope3/src/zope/app/_app.py:1.14.2.3 Tue Aug 5 19:24:59 2003
+++ Zope3/src/zope/app/_app.py Fri Aug 8 10:43:48 2003
@@ -22,6 +22,7 @@
from zope.publisher.browser import TestRequest
from zope.app.publication.browser import BrowserPublication
import zope.configuration.xmlconfig
+import zope.component.service
__metaclass__ = type
@@ -35,7 +36,6 @@
return
import zope.app.configuration
- import zope.app.component.service
# Set user to system_user, so we can do anything we want
from zope.security.management import system_user
@@ -43,7 +43,8 @@
newSecurityManager(system_user)
# Load server-independent site config
- sm = zope.app.component.service.globalServiceManager()
+ sm = zope.component.service.serviceManager
+ bootstrap_services(sm)
context = zope.app.configuration.ConfigurationMachine(sm)
zope.configuration.xmlconfig.registerCommonDirectives(context)
zope.configuration.xmlconfig.file(file, context=context, execute=execute)
@@ -55,6 +56,24 @@
_configured = execute
return context
+
+def bootstrap_services(sm):
+ import zope.app.interfaces
+ import zope.app.component.globalinterfaceservice
+ from zope.app.services import servicenames
+
+ # only bootstrap the interface service for now
+ services = {
+ servicenames.Interfaces: (
+ zope.app.interfaces.component.IInterfaceService,
+ zope.app.component.globalinterfaceservice.interfaceService,
+ ),
+ }
+
+ for name in services:
+ i, c = services[name]
+ sm.defineService(name, i)
+ sm.provideService(name, c)
def database(db):
if type(db) is str:
More information about the Zope3-Checkins
mailing list