Update of /cvsroot/mailman/mailman3/bin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22227

Modified Files:
        webserver 
Log Message:
render(): Redirect / to /listinfo

__main__: We don't need to call shutdown explicitly since we're now setting an
atexit handler.


Index: webserver
===================================================================
RCS file: /cvsroot/mailman/mailman3/bin/webserver,v
retrieving revision 3.2
retrieving revision 3.3
diff -u -d -r3.2 -r3.3
--- webserver   21 Apr 2004 03:31:35 -0000      3.2
+++ webserver   22 Apr 2004 23:05:48 -0000      3.3
@@ -26,6 +26,7 @@
 import paths
 
 from twisted.internet import reactor
+from twisted.protocols import http
 from twisted.web import server, resource
 
 from mailman import startup
@@ -72,13 +73,19 @@
 
 
 class MailmanResource(resource.Resource):
+    # We'll manage our own resource tree for now.  This lets us centralize
+    # database transactions and makes the "cgi" scripts pretty simple.
     isLeaf = True
 
     def render(self, request):
+        # No path means /listinfo
+        if request.path == '/':
+            request.setHeader('Location', '/listinfo')
+            request.setResponseCode(http.MOVED_PERMANENTLY)
+            return ''
         # Get the first component
         parts = request.path.split('/')[1:]
-        if not parts:
-            parts.append('listinfo')
+        assert parts and parts[0]
         # The module name is mailman.cgi.do_<part>
         modname = 'mailman.cgi.do_%s' % parts[0]
         try:
@@ -86,7 +93,7 @@
             func = sys.modules[modname].process
         except AttributeError:
             log.error('bad process module: %s', modname)
-            return
+            return ''
         # Start a transaction so if anything goes wrong, we can abort the
         # entire creation of the list.
         txnlist = txnuser = None
@@ -144,8 +151,5 @@
     options, parser = parseargs()
     configuration.configure(options.configfile)
     if configuration.webserver.enable:
-        try:
-            log = logging.getLogger('mailman.error')
-            main()
-        finally:
-            startup.shutdown()
+        log = logging.getLogger('mailman.error')
+        main()


_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to