[Checkins] SVN: z3c.recipe.winservice/trunk/ Use python.exe in debug mode -- it will display/log exceptions

Adam Groszer agroszer at gmail.com
Sun May 10 04:25:10 EDT 2009


Log message for revision 99817:
  Use python.exe in debug mode -- it will display/log exceptions

Changed:
  U   z3c.recipe.winservice/trunk/CHANGES.txt
  U   z3c.recipe.winservice/trunk/src/z3c/recipe/winservice/README.txt
  U   z3c.recipe.winservice/trunk/src/z3c/recipe/winservice/winservice.in

-=-
Modified: z3c.recipe.winservice/trunk/CHANGES.txt
===================================================================
--- z3c.recipe.winservice/trunk/CHANGES.txt	2009-05-10 07:11:25 UTC (rev 99816)
+++ z3c.recipe.winservice/trunk/CHANGES.txt	2009-05-10 08:25:10 UTC (rev 99817)
@@ -5,7 +5,7 @@
 Version 0.7.0 (unreleased)
 --------------------------
 
-- ...
+- Use python.exe in debug mode -- it will display/log exceptions
 
 
 Version 0.6.0 (2009-05-10)

Modified: z3c.recipe.winservice/trunk/src/z3c/recipe/winservice/README.txt
===================================================================
--- z3c.recipe.winservice/trunk/src/z3c/recipe/winservice/README.txt	2009-05-10 07:11:25 UTC (rev 99816)
+++ z3c.recipe.winservice/trunk/src/z3c/recipe/winservice/README.txt	2009-05-10 08:25:10 UTC (rev 99817)
@@ -191,7 +191,7 @@
   PYTHONW = os.path.join(PYTHONDIR, 'pythonw.exe')
   PYTHONSERVICE_EXE = r'%s\Lib\site-packages\win32\pythonservice.exe' % PYTHONDIR
   TOSTART = r'/sample-buildout/bin/app-script.py'
-  SERVICE_NAME = '..._bin_app_script_py'
+  SERVICE_NAME = '...sample_buildout_bin_app_script_py'
   SERVICE_DISPLAY_NAME = r'Zope 3 Windows Service'
   SERVICE_DESCRIPTION = r'Zope 3 Windows Service description'
   <BLANKLINE>
@@ -253,11 +253,15 @@
       start_cmd = ''
   <BLANKLINE>
       def __init__(self, args):
-          python = PYTHONW
-          if not os.path.exists(PYTHONW):
+          if TOSTART.endswith('-servicedebug.py'):
+              #we're better off with python.exe
+              python = PYTHON
+          else:
+              python = PYTHONW
+          if not os.path.exists(python):
               #virtualenv misses pythonw.exe, fall back to python.exe
               python = PYTHON
-              if not os.path.exists(PYTHON):
+              if not os.path.exists(python):
                   raise OSError("%s or %s does not exist" % (PYTHONW, PYTHON))
   <BLANKLINE>
           if not os.path.exists(TOSTART):

Modified: z3c.recipe.winservice/trunk/src/z3c/recipe/winservice/winservice.in
===================================================================
--- z3c.recipe.winservice/trunk/src/z3c/recipe/winservice/winservice.in	2009-05-10 07:11:25 UTC (rev 99816)
+++ z3c.recipe.winservice/trunk/src/z3c/recipe/winservice/winservice.in	2009-05-10 08:25:10 UTC (rev 99817)
@@ -152,11 +152,15 @@
     start_cmd = ''
 
     def __init__(self, args):
-        python = PYTHONW
-        if not os.path.exists(PYTHONW):
+        if TOSTART.endswith('-servicedebug.py'):
+            #we're better off with python.exe
+            python = PYTHON
+        else:
+            python = PYTHONW
+        if not os.path.exists(python):
             #virtualenv misses pythonw.exe, fall back to python.exe
             python = PYTHON
-            if not os.path.exists(PYTHON):
+            if not os.path.exists(python):
                 raise OSError("%s or %s does not exist" % (PYTHONW, PYTHON))
 
         if not os.path.exists(TOSTART):



More information about the Checkins mailing list