[Zope-Checkins] CVS: Zope/lib/python/nt_svcutils - service.py:1.4.2.2

Jeremy Hylton jeremy at zope.com
Mon Jan 26 12:22:32 EST 2004


Update of /cvs-repository/Zope/lib/python/nt_svcutils
In directory cvs.zope.org:/tmp/cvs-serv23157/Zope/lib/python/nt_svcutils

Modified Files:
      Tag: jeremy-windows-service-branch
	service.py 
Log Message:
Improved debugging prints.


=== Zope/lib/python/nt_svcutils/service.py 1.4.2.1 => 1.4.2.2 ===
--- Zope/lib/python/nt_svcutils/service.py:1.4.2.1	Mon Jan 26 12:13:55 2004
+++ Zope/lib/python/nt_svcutils/service.py	Mon Jan 26 12:22:28 2004
@@ -158,7 +158,7 @@
 
         keep_running = True
         # ignore stdin
-        print handles
+        print "stdin=%s stdout=%s stderr=%s" % handles
         win32file.CloseHandle(handles[0])
         fd = msvcrt.open_osfhandle(handles[1], 0)
         stdout = os.fdopen(fd)
@@ -181,16 +181,19 @@
                 status = win32process.GetExitCodeProcess(self.hZope)
                 # exit status 0 means the user caused a clean shutdown,
                 # presumably via the web interface
+                print "exit status", status
                 keep_running = status != 0
                 break
             else:
                 i = rc - (win32event.WAIT_OBJECT_0 + 2)
                 if i == 0:
                     data = stdout.read(8192)
-                    self.info("stdout: %s" % data)
+                    if data:
+                        self.info("stdout: %s" % data)
                 elif i == 1:
                     data = stderr.read(8192)
-                    self.info("stderr: %s" % data)
+                    if data:
+                        self.info("stderr: %s" % data)
         stdout.close()
         stderr.close()
         return keep_running
@@ -237,7 +240,6 @@
         # circumstances of a service process.
         info = win32process.CreateProcess(None, cmd, None, None, True, 0,
                                           None, None, si)
-        print "createprocess", info
 
         win32file.CloseHandle(stdin[0])
         win32file.CloseHandle(stdout[1])




More information about the Zope-Checkins mailing list