changeset 2021:f4a16b186efc

proper fix this time
author Richard Jones <richard@users.sourceforge.net>
date Sun, 15 Feb 2004 21:55:10 +0000
parents 027b297ce23c
children e13d11bb7ee8
files roundup/scripts/roundup_server.py
diffstat 1 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/scripts/roundup_server.py	Sun Feb 15 21:44:02 2004 +0000
+++ b/roundup/scripts/roundup_server.py	Sun Feb 15 21:55:10 2004 +0000
@@ -17,7 +17,7 @@
 
 """Command-line script that runs a server over roundup.cgi.client.
 
-$Id: roundup_server.py,v 1.38 2004-02-15 21:44:02 richard Exp $
+$Id: roundup_server.py,v 1.39 2004-02-15 21:55:10 richard Exp $
 """
 __docformat__ = 'restructuredtext'
 
@@ -70,17 +70,6 @@
 r3fPdUcIYeyEfLSAJ0LeAUZHCAt8Al/8/kLIEWDB5YDj0wm8fAP6fVfo
 '''.strip()))
 
-class RoundupHTTPServer(SafeLogging, BaseHTTPServer.HTTPServer):
-    def log_message(self, format, *args):
-        ''' Try to use the logging package, otherwise *safely* log to
-            stderr.
-        '''
-        try:
-            BaseHTTPServer.HTTPServer.log_message(self, format, *args)
-        except IOError:
-            # stderr is no longer viable, we can't log
-            pass
-
 class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
     TRACKER_HOMES = TRACKER_HOMES
     ROUNDUP_USER = ROUNDUP_USER
@@ -223,6 +212,16 @@
             host, port = self.client_address
             return socket.getfqdn(host)
 
+    def log_message(self, format, *args):
+        ''' Try to *safely* log to stderr.
+        '''
+        try:
+            BaseHTTPServer.BaseHTTPRequestHandler.log_message(self,
+                format, *args)
+        except IOError:
+            # stderr is no longer viable
+            pass
+
 def error():
     exc_type, exc_value = sys.exc_info()[:2]
     return _('Error: %s: %s' % (exc_type, exc_value))
@@ -240,7 +239,8 @@
 
     SvcShutdown = "ServiceShutdown"
 
-    class RoundupService(win32serviceutil.ServiceFramework, RoundupHTTPServer):
+    class RoundupService(win32serviceutil.ServiceFramework,
+            BaseHTTPServer.HTTPServer):
         ''' A Roundup standalone server for Win32 by Ewout Prangsma
         '''
         _svc_name_ = "Roundup Bug Tracker"
@@ -252,7 +252,7 @@
                 # appending, unbuffered
                 sys.stdout = sys.stderr = open(LOGFILE, 'a', 0)
             win32serviceutil.ServiceFramework.__init__(self, args)
-            RoundupHTTPServer.__init__(self, self.address, 
+            BaseHTTPServer.HTTPServer.__init__(self, self.address, 
                 RoundupRequestHandler)
 
             # Create the necessary NT Event synchronization objects...
@@ -341,7 +341,7 @@
  -p: sets the port to listen on (default: %(port)s)
  -u: sets the uid to this user after listening on the port
  -g: sets the gid to this group after listening on the port
- -l: sets a filename to log to (instead of stdout)
+ -l: sets a filename to log to (instead of stderr / stdout)
  -d: run the server in the background and on UN*X write the server's PID
      to the nominated file. The -l option *must* be specified if this
      option is.
@@ -445,7 +445,7 @@
         # 1024 if started as root
         address = (hostname, port)
         try:
-            httpd = RoundupHTTPServer(address, RoundupRequestHandler)
+            httpd = BaseHTTPServer.HTTPServer(address, RoundupRequestHandler)
         except socket.error, e:
             if e[0] == errno.EADDRINUSE:
                 raise socket.error, \

Roundup Issue Tracker: http://roundup-tracker.org/