[Zodb-checkins] CVS: Zope3/src/ZODB/zodb4 - main.py:1.3

Jim Fulton jim at zope.com
Mon Feb 23 06:54:46 EST 2004


Update of /cvs-repository/Zope3/src/ZODB/zodb4
In directory cvs.zope.org:/tmp/cvs-serv30804/src/ZODB/zodb4

Modified Files:
	main.py 
Log Message:
Now read site.zcml, to pick up module aliases.

Remove the index file after creation. I need to look at this some
more. Why is the saved alias file incorrect? Why isn't the bogosity
recognized when the file is opened?


=== Zope3/src/ZODB/zodb4/main.py 1.2 => 1.3 ===
--- Zope3/src/ZODB/zodb4/main.py:1.2	Fri Feb 20 14:01:07 2004
+++ Zope3/src/ZODB/zodb4/main.py	Mon Feb 23 06:54:45 2004
@@ -55,6 +55,11 @@
         self.parse_args(args)
 
     def run(self):
+        
+        # Load server-independent site config
+        from zope.configuration import xmlconfig
+        context = xmlconfig.file('site.zcml', execute=True)
+
         if not os.path.exists(self.dbfile):
             self.error("input database does not exist: %s" % self.dbfile)
         base, ext = os.path.splitext(self.dbfile)
@@ -70,6 +75,9 @@
             self.error("backup database index already exists: %s\n"
                        "please move aside and try again" % self.bakindex)
         self.convert()
+
+        # XXX the conversion script leaves an invalid index behind. Why?
+        os.remove(self.dbindex)
 
     def convert(self):
         lock = LockFile(self.bakfile + ".lock")




More information about the Zodb-checkins mailing list