[Zope-Checkins] CVS: Zope/lib/python/Zope - __init__.py:1.31.4.2
Chris McDonough
chrism@zope.com
Mon, 21 Oct 2002 21:29:45 -0400
Update of /cvs-repository/Zope/lib/python/Zope
In directory cvs.zope.org:/tmp/cvs-serv26263/lib/python/Zope
Modified Files:
Tag: chrism-install-branch
__init__.py
Log Message:
Far enough along to remove any dependency on custom_zodb.py.
=== Zope/lib/python/Zope/__init__.py 1.31.4.1 => 1.31.4.2 ===
--- Zope/lib/python/Zope/__init__.py:1.31.4.1 Tue Sep 3 03:43:48 2002
+++ Zope/lib/python/Zope/__init__.py Mon Oct 21 21:29:45 2002
@@ -18,34 +18,17 @@
import sys, os, App.FindHomes
sys.path.insert(0, os.path.join(SOFTWARE_HOME, 'ZopeZODB3'))
#######################################################################
-import ZODB, ZODB.ZApplication, imp
+import ZODB, ZODB.ZApplication
import Globals, OFS.Application, sys
import AccessControl.SecurityManagement, AccessControl.User
+from Controller.Directives import DirectiveRegistry
-Globals.BobobaseName = os.path.join(Globals.data_dir, 'Data.fs')
-Globals.DatabaseVersion='3'
# Import products
OFS.Application.import_products()
-
-# Open the database
-try:
- # Try to use custom storage
- m=imp.find_module('custom_zodb',[INSTANCE_HOME])
-except:
- import ZODB.FileStorage
- DB=ZODB.FileStorage.FileStorage(Globals.BobobaseName)
- DB=ZODB.DB(DB)
-else:
- m=imp.load_module('Zope.custom_zodb', m[0], m[1], m[2])
- if hasattr(m,'DB'):
- DB=m.DB
- else:
- DB=m.Storage
- DB=ZODB.DB(DB)
-
- Globals.BobobaseName = DB.getName()
- sys.modules['Zope.custom_zodb']=m
+DB = DirectiveRegistry['main_zodb_database']() # directive is a callable
+Globals.BobobaseName = DB.getName()
+Globals.DatabaseVersion='3'
if DB.getActivityMonitor() is None:
from ZODB.ActivityMonitor import ActivityMonitor