changeset 4348:b3602f5e2038

standalone server: fix serverClass argument processing, announce used serverClass in log
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 28 Sep 2008 15:59:46 +0200
parents 61b60d54b591
children 5e69ec45d0c9 361c6d95ebf3
files MoinMoin/script/server/standalone.py MoinMoin/server/server_standalone.py
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/server/standalone.py	Thu Sep 25 17:47:46 2008 +0200
+++ b/MoinMoin/script/server/standalone.py	Sun Sep 28 15:59:46 2008 +0200
@@ -67,9 +67,8 @@
         if self.args:
             self.parser.error("incorrect number of arguments")
 
-        thread_choices = ["ThreadPool", "Threading", "Forking", "Simple"]
-        serverClass = "ThreadPool"
         if self.options.serverClass:
+            thread_choices = ["ThreadPool", "Threading", "Forking", "Simple"]
             thread_choices2 = [x.upper() for x in thread_choices]
             thread_choice = self.options.serverClass.upper()
             try:
@@ -77,6 +76,8 @@
             except ValueError:
                 self.parser.error("invalid serverClass type")
             serverClass = thread_choices[serverClass_index]
+        else:
+            serverClass = None
 
         pidfile = "moin.pid"
         if self.options.pidfile:
@@ -116,7 +117,8 @@
                 Config.port = self.options.port
             if self.options.interface:
                 Config.interface = self.options.interface
-            Config.serverClass = serverClass + 'Server'
+            if serverClass:
+                Config.serverClass = serverClass + 'Server'
             if self.options.threadLimit:
                 Config.threadLimit = self.options.threadLimit
             if self.options.requestQueueSize:
--- a/MoinMoin/server/server_standalone.py	Thu Sep 25 17:47:46 2008 +0200
+++ b/MoinMoin/server/server_standalone.py	Sun Sep 28 15:59:46 2008 +0200
@@ -67,7 +67,9 @@
 
     def server_activate(self):
         BaseHTTPServer.HTTPServer.server_activate(self)
-        logging.info("Serving on %s:%d" % self.server_address)
+        logging.info("%s serving on %s:%d" % (self.__class__.__name__,
+                                              self.server_address[0],
+                                              self.server_address[1]))
 
     def serve_forever(self):
         """Handle one request at a time until we die """