[Zodb-checkins] CVS: ZODB3/ZEO - runsvr.py:1.5

Guido van Rossum guido@python.org
Tue, 19 Nov 2002 14:38:31 -0500


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv27159

Modified Files:
	runsvr.py 
Log Message:
Get rid of the -d option; you can do this with the -z option of
zdaemon/zdaemon.py.

Also get rid of the sys.path manipulation; it doesn't work (since the
C extensions are not there).


=== ZODB3/ZEO/runsvr.py 1.4 => 1.5 ===
--- ZODB3/ZEO/runsvr.py:1.4	Tue Nov 19 14:32:12 2002
+++ ZODB3/ZEO/runsvr.py	Tue Nov 19 14:38:29 2002
@@ -14,12 +14,11 @@
 ##############################################################################
 """Start the ZEO storage server.
 
-Usage: %s [-a ADDRESS] [-d DIRECTORY] [-f FILENAME] [-s STORAGE]
+Usage: %s [-a ADDRESS] [-f FILENAME] [-s STORAGE]
 
 Options:
 -a/--address ADDRESS -- server address of the form PORT, HOST:PORT, or PATH
                         (a PATH must contain at least one "/")
--d/--directory DIRECTORY -- home directory (default $INSTANCE_HOME or `pwd`)
 -f/--filename FILENAME -- filename for FileStorage
 -s/--storage STORAGE -- storage specification of the form
                         NAME=MODULE[:ATTRIBUTE]
@@ -40,11 +39,6 @@
 import signal
 import socket
 
-if __name__ == "__main__":
-    # Add the parent of the script directory to the module search path
-    from os.path import dirname, abspath, normpath
-    sys.path.append(dirname(dirname(normpath(abspath(sys.argv[0])))))
-
 import zLOG
 
 
@@ -140,12 +134,10 @@
     address = None
     storages = None
     filename = None
-    directory = None
 
-    _short_options = "a:d:f:hs:"
+    _short_options = "a:f:hs:"
     _long_options = [
         "--address=",
-        "--directory=",
         "--filename=",
         "--help",
         "--storage=",
@@ -169,8 +161,6 @@
                 except: # int() can raise all sorts of errors
                     self.usage("invalid port number: %r" % port)
                 self.address = (host, port)
-        elif opt in ("-d", "--directory"):
-            self.directory = arg
         elif opt in ("-f", "--filename"):
             self.filename = arg
         elif opt in ("-s", "--storage"):
@@ -212,7 +202,6 @@
     def main(self):
         self.check_socket()
         self.clear_socket()
-        self.change_dir()
         self.open_storages()
         self.setup_signals()
         try:
@@ -240,13 +229,6 @@
                 os.unlink(self.opts.address)
             except os.error:
                 pass
-
-    def change_dir(self):
-        if self.opts.directory:
-            try:
-                os.chdir(self.opts.directory)
-            except os.error:
-                self.opts.usage("can't chdir into %r" % self.opts.directory)
 
     def open_storages(self):
         if self.opts.storages: