[Zope-Checkins] CVS: Zope/lib/python/Zope/App - startup.py:1.6

Chris McDonough chrism@zope.com
Tue, 8 Apr 2003 13:56:41 -0400


Update of /cvs-repository/Zope/lib/python/Zope/App
In directory cvs.zope.org:/tmp/cvs-serv29720/lib/python/Zope/App

Modified Files:
	startup.py 
Log Message:
Wire up ZODB database configuration via configuration file.


=== Zope/lib/python/Zope/App/startup.py 1.5 => 1.6 ===
--- Zope/lib/python/Zope/App/startup.py:1.5	Tue Feb 11 12:17:09 2003
+++ Zope/lib/python/Zope/App/startup.py	Tue Apr  8 13:56:11 2003
@@ -48,9 +48,11 @@
         # Try to use custom storage
         m=imp.find_module('custom_zodb',[getConfiguration().instancehome])
     except:
-        import ZODB.FileStorage
-        storage = ZODB.FileStorage.FileStorage(Globals.BobobaseName)
-        DB = ZODB.DB(storage)
+        # if there is no custom_zodb, use the config file specified databases
+        config = getConfiguration()
+        name = config.db_mount_tab['/']
+        DB = config.db_name_tab[name].open()
+        Globals.BobobaseName = name
     else:
         m=imp.load_module('Zope.custom_zodb', m[0], m[1], m[2])
         if hasattr(m,'DB'):