changeset 4525:b29b90a71625

revert (wrong) frontend related changesets (see below for details) Changesets reverted: 7f17aad0ab8987f4a04f65f9a281303190d541c4 web.frontend: fixed FrontEnd.run for CGI 74e850a410ecf4e92d3f37fdf7ca369d7c9d94bb web.flup_frontend: fixed missing definition of server_types. c6fa175c7b62c51de10877f2875ebf8e47cfd9d5 web.frontend: fixed undefined run_server
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 01 Feb 2009 21:56:29 +0100
parents 3e660579be91
children 1d06e13ce1ee
files MoinMoin/web/flup_frontend.py MoinMoin/web/frontend.py
diffstat 2 files changed, 7 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/flup_frontend.py	Sun Feb 01 20:28:47 2009 +0100
+++ b/MoinMoin/web/flup_frontend.py	Sun Feb 01 21:56:29 2009 +0100
@@ -58,23 +58,19 @@
 
         def run_server(self, application, options):
             server_type = options.server_type
-            # ToDo solve server_types mismatch of definitions
-            server_types = ['single', 'threaded']
 
             if not server_type:
-                if 'single' in server_types:
+                if 'single' in self.server_types:
                     server_type = (options.port and 'threaded') or 'single'
                 else:
                     server_type = 'threaded'
 
-            if server_type not in server_types:
+            if server_type not in self.server_types:
                 raise TypeError("Unknown server type '%s'" % options.server_type)
 
             multi = server_type in ('threaded', 'forking')
-            # ToDo find a better solution, there are more servers available
-            server_types = {'single': 'flup.server.fcgi_single',
-                            'threaded': 'flup.server.fcgi'}
-            mod = server_types[server_type]
+
+            mod = self.server_types[server_type]
             mod = __import__(mod, fromlist=['WSGIServer'])
             WSGIServer = mod.WSGIServer
 
--- a/MoinMoin/web/frontend.py	Sun Feb 01 20:28:47 2009 +0100
+++ b/MoinMoin/web/frontend.py	Sun Feb 01 21:56:29 2009 +0100
@@ -8,6 +8,7 @@
 import optparse
 
 from MoinMoin.web.serving import make_application
+
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
@@ -36,13 +37,9 @@
             application = make_application(shared=options.htdocs)
         else:
             application = make_application()
+
         try:
-            if self.__class__.__name__ == "CGIFrontEnd":
-                from MoinMoin.web._fallback_cgi import WSGIServer
-                return WSGIServer(application).run()
-            else:
-                from MoinMoin.web.flup_frontend import FlupFrontEnd
-                return FlupFrontEnd().run_server(application, options)
+            self.run_server(application, options)
         except:
             logging.error('Error while running %s', self.__class__.__name__)
             raise