[Zope-Checkins] CVS: Zope/lib/python/Zope/App - startup.py:1.4
Chris McDonough
chrism@zope.com
Mon, 6 Jan 2003 12:56:56 -0500
Update of /cvs-repository/Zope/lib/python/Zope/App
In directory cvs.zope.org:/tmp/cvs-serv23008
Modified Files:
startup.py
Log Message:
Revert change that was mistakenly merged from chrism-install-branch into the
trunk.
=== Zope/lib/python/Zope/App/startup.py 1.3 => 1.4 ===
--- Zope/lib/python/Zope/App/startup.py:1.3 Sat Jan 4 23:07:29 2003
+++ Zope/lib/python/Zope/App/startup.py Mon Jan 6 12:56:54 2003
@@ -31,38 +31,25 @@
import ZPublisher
import ExtensionClass
from zLOG import LOG, WARNING, INFO, BLATHER, log_time
-from Zope import Startup
-def startup():
- config = Startup.getConfiguration()
+def startup():
global ZODB, app
+ Globals.BobobaseName = os.path.join(Globals.data_dir, 'Data.fs')
Globals.DatabaseVersion='3'
# Import products
OFS.Application.import_products()
- # Set up a root database from zconfig data
- zconfig_db = None
- set_root = 0
-
- for mount_points, dbfactory in config.databases:
- # only use root for now
- if '/' in mount_points:
- if set_root:
- raise ConfigurationError, (
- "Cannot specify more than one 'root' / database"
- )
- zconfig_db = dbfactory()
- Globals.BobobaseName = zconfig_db.getName()
- set_root = 1
-
+ # Open the database
try:
- # Root db/storage in custom_zodb overrides zconfig_db
+ # Try to use custom storage
m=imp.find_module('custom_zodb',[INSTANCE_HOME])
except:
- DB = zconfig_db
+ import ZODB.FileStorage
+ storage = ZODB.FileStorage.FileStorage(Globals.BobobaseName)
+ DB = ZODB.DB(storage)
else:
m=imp.load_module('Zope.custom_zodb', m[0], m[1], m[2])
if hasattr(m,'DB'):
@@ -73,9 +60,6 @@
Globals.BobobaseName = DB.getName()
sys.modules['Zope.custom_zodb']=m
-
- if DB is None:
- raise Startup.ConfigurationError, "Must specify a root ('/') database"
if DB.getActivityMonitor() is None:
from ZODB.ActivityMonitor import ActivityMonitor