summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5470c20)
raw | patch | inline | side by side (parent: 5470c20)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 15 Feb 2004 21:55:10 +0000 (21:55 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 15 Feb 2004 21:55:10 +0000 (21:55 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2089 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/scripts/roundup_server.py | patch | blob | history |
index c40a71c02b7616c8be4fc98bfe74103cf3f737c8..5a9c5096ff9f6f89c24dae842b7606f7793e4734 100644 (file)
"""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'
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
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))
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"
# 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...
-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.
# 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, \