[Zodb-checkins] CVS: ZODB3/ZEO - runsvr.py:1.13
Guido van Rossum
guido@python.org
Fri, 22 Nov 2002 14:32:29 -0500
Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv14750
Modified Files:
runsvr.py
Log Message:
Allow multiple -f options.
=== ZODB3/ZEO/runsvr.py 1.12 => 1.13 ===
--- ZODB3/ZEO/runsvr.py:1.12 Fri Nov 22 14:00:04 2002
+++ ZODB3/ZEO/runsvr.py Fri Nov 22 14:32:28 2002
@@ -183,7 +183,10 @@
self.address = (host, port)
elif opt in ("-f", "--filename"):
from ZODB.FileStorage import FileStorage
- self.storages = {"1": (FileStorage, {"file_name": arg})}
+ if not self.storages:
+ self.storages = {}
+ key = str(1 + len(self.storages))
+ self.storages[key] = (FileStorage, {"file_name": arg})
else:
# Pass it to the base class, for --help/-h
Options.handle_option(self, opt, arg)
@@ -273,6 +276,9 @@
name = section.name
if not name:
name = str(1 + len(self.storages))
+ if self.storages.has_key(name):
+ # (Actually, the parser doesn't allow this)
+ self.usage("duplicate storage name %r" % name)
self.storages[name] = ZConfig.Storage.getStorageInfo(section)