[Zope-Checkins] CVS: Zope/lib/python/Zope/App - startup.py:1.2.4.3
Chris McDonough
chrism@zope.com
Sun, 24 Nov 2002 19:21:09 -0500
Update of /cvs-repository/Zope/lib/python/Zope/App
In directory cvs.zope.org:/tmp/cvs-serv22042
Modified Files:
Tag: chrism-install-branch
startup.py
Log Message:
Merge with HEAD.
=== Zope/lib/python/Zope/App/startup.py 1.2.4.2 => 1.2.4.3 ===
--- Zope/lib/python/Zope/App/startup.py:1.2.4.2 Sun Oct 27 01:09:14 2002
+++ Zope/lib/python/Zope/App/startup.py Sun Nov 24 19:21:08 2002
@@ -30,7 +30,7 @@
import AccessControl.User
import ZPublisher
import ExtensionClass
-from Controller.Directives import DirectiveRegistry
+from Controller import configuration, ConfigurationError
from zLOG import LOG, WARNING, INFO, BLATHER, log_time
@@ -43,7 +43,23 @@
# Import products
OFS.Application.import_products()
- DB = DirectiveRegistry['zodb_databases']['/']() # directive is a callable
+ databases = configuration['databases']
+
+ DB = None
+
+ set_root = 0
+ for mount_points, dbfactory in databases:
+ # only use root for now
+ if '/' in mount_points:
+ if set_root:
+ raise ConfigurationError, (
+ "Cannot specify more than one 'root' / database"
+ )
+ DB = dbfactory()
+ set_root = 1
+
+ if DB is None:
+ raise ConfigurationError, "Must specify a root ('/') database"
if DB.getActivityMonitor() is None:
from ZODB.ActivityMonitor import ActivityMonitor