[Zope-Checkins] CVS: Zope/utilities - mkzopeinstance.py:1.2.2.5

Chris McDonough chrism at zope.com
Mon Aug 25 18:32:48 EDT 2003


Update of /cvs-repository/Zope/utilities
In directory cvs.zope.org:/tmp/cvs-serv30792/utilities

Modified Files:
      Tag: Zope-2_7-branch
	mkzopeinstance.py 
Log Message:
Merge from HEAD.

Make a distinction under Windows between pythonw.exe and python.exe (each are useful in different ways).



=== Zope/utilities/mkzopeinstance.py 1.2.2.4 => 1.2.2.5 ===
--- Zope/utilities/mkzopeinstance.py:1.2.2.4	Fri Aug 15 19:56:56 2003
+++ Zope/utilities/mkzopeinstance.py	Mon Aug 25 17:32:48 2003
@@ -91,12 +91,33 @@
     if not (user or os.path.exists(inituser)):
         user, password = get_inituser()
 
+    # we need to distinguish between python.exe and pythonw.exe under
+    # Windows in order to make Zope run using python.exe when run in a
+    # console window and pythonw.exe when run as a service, so we do a bit
+    # of sniffing here.
+    psplit = os.path.split(sys.executable)
+    exedir = os.path.join(*psplit[:-1])
+    pythonexe = os.path.join(exedir, 'python.exe')
+    pythonwexe = os.path.join(exedir, 'pythonw.exe')
+
+    if ( os.path.isfile(pythonwexe) and os.path.isfile(pythonexe) and
+         (sys.executable in [pythonwexe, pythonexe]) ):
+        # we're using a Windows build with both python.exe and pythonw.exe
+        # in the same directory
+        PYTHON = pythonexe
+        PYTHONW = pythonwexe
+    else:
+        # we're on UNIX or we have a nonstandard Windows setup
+        PYTHON = PYTHONW = sys.executable
+
     kw = {
-        "PYTHON": sys.executable,
+        "PYTHON":PYTHON,
+        "PYTHONW":PYTHONW,
         "INSTANCE_HOME": instancehome,
         "SOFTWARE_HOME": softwarehome,
         "ZOPE_HOME": zopehome,
         }
+
     copyzopeskel.copyskel(skelsrc, skeltarget, None, None, **kw)
     write_inituser(inituser, user, password)
 




More information about the Zope-Checkins mailing list