[Zodb-checkins] CVS: ZODB3/zdaemon - zdctl.py:1.17
Guido van Rossum
guido@python.org
Mon, 20 Jan 2003 10:11:11 -0500
Update of /cvs-repository/ZODB3/zdaemon
In directory cvs.zope.org:/tmp/cvs-serv15172
Modified Files:
zdctl.py
Log Message:
Several recent changes (some before, some after the alpha 1 release)
broke this badly, and needed repair:
- Allow positional arguments by setting class variable
positional_args_allowed.
- Reference zdrun.py, not zdaemon.py, to run the program.
- Don't use relative import to get zdoptions module.
- Renamed ZDOptions class to ZDCtlOptions; the base class is already
called ZDOptions.
=== ZODB3/zdaemon/zdctl.py 1.16 => 1.17 ===
--- ZODB3/zdaemon/zdctl.py:1.16 Thu Jan 16 23:15:37 2003
+++ ZODB3/zdaemon/zdctl.py Mon Jan 20 10:11:08 2003
@@ -48,14 +48,16 @@
sys.path.append(dirname(dirname(normpath(abspath(sys.argv[0])))))
import ZConfig
-import zdoptions
+from zdaemon.zdoptions import ZDOptions
def string_list(arg):
return arg.split()
-class ZDOptions(zdoptions.ZDOptions):
+class ZDCtlOptions(ZDOptions):
+
+ positional_args_allowed = 1
# Where's python?
python = sys.executable
@@ -67,7 +69,7 @@
_file = __file__
_file = os.path.normpath(os.path.abspath(_file))
_dir = os.path.dirname(_file)
- zdaemon = os.path.join(_dir, "zdaemon.py")
+ zdaemon = os.path.join(_dir, "zdrun.py")
# Options for zdaemon
backofflimit = 10 # -b SECONDS
@@ -78,7 +80,7 @@
zdirectory = "/" # -z DIRECTORY
def __init__(self):
- zdoptions.ZDOptions.__init__(self)
+ ZDOptions.__init__(self)
self.add("program", "zdctl.program", "p:", "program=",
handler=string_list,
required="no program specified; use -p or -C")
@@ -337,7 +339,7 @@
"stop the daemon manager.")
def main(args=None):
- options = ZDOptions()
+ options = ZDCtlOptions()
options.realize(args)
c = ZDCmd(options)
if options.args: