diff roundup/scripts/roundup_server.py @ 1096:fa7df238e2d4

More cleaning up of configuration, and the "instance" -> "tracker" renaming.
author Richard Jones <richard@users.sourceforge.net>
date Tue, 10 Sep 2002 03:01:20 +0000
parents e5826025eeb7
children 49aebf5a8691
line wrap: on
line diff
--- a/roundup/scripts/roundup_server.py	Tue Sep 10 02:37:28 2002 +0000
+++ b/roundup/scripts/roundup_server.py	Tue Sep 10 03:01:20 2002 +0000
@@ -16,7 +16,7 @@
 # 
 """ HTTP Server that serves roundup.
 
-$Id: roundup_server.py,v 1.9 2002-09-10 01:07:06 richard Exp $
+$Id: roundup_server.py,v 1.10 2002-09-10 03:01:19 richard Exp $
 """
 
 # python version check
@@ -35,7 +35,7 @@
 #
 
 # This indicates where the Roundup instance lives
-ROUNDUP_INSTANCE_HOMES = {
+TRACKER_HOMES = {
     'bar': '/tmp/bar',
 }
 
@@ -57,7 +57,7 @@
 
 
 class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
-    ROUNDUP_INSTANCE_HOMES = ROUNDUP_INSTANCE_HOMES
+    TRACKER_HOMES = TRACKER_HOMES
     ROUNDUP_USER = ROUNDUP_USER
 
     def run_cgi(self):
@@ -101,7 +101,7 @@
         w = self.wfile.write
         w(_('<html><head><title>Roundup instances index</title></head>\n'))
         w(_('<body><h1>Roundup instances index</h1><ol>\n'))
-        for instance in self.ROUNDUP_INSTANCE_HOMES.keys():
+        for instance in self.TRACKER_HOMES.keys():
             w(_('<li><a href="%(instance_url)s/index">%(instance_name)s</a>\n')%{
                 'instance_url': urllib.quote(instance),
                 'instance_name': cgi.escape(instance)})
@@ -123,8 +123,8 @@
             return self.index()
         l_path = rest.split('/')
         instance_name = urllib.unquote(l_path[1])
-        if self.ROUNDUP_INSTANCE_HOMES.has_key(instance_name):
-            instance_home = self.ROUNDUP_INSTANCE_HOMES[instance_name]
+        if self.TRACKER_HOMES.has_key(instance_name):
+            instance_home = self.TRACKER_HOMES[instance_name]
             instance = roundup.instance.open(instance_home)
         else:
             raise client.NotFound
@@ -137,7 +137,7 @@
 
         # Set up the CGI environment
         env = {}
-        env['INSTANCE_NAME'] = instance_name
+        env['TRACKER_NAME'] = instance_name
         env['REQUEST_METHOD'] = self.command
         env['PATH_INFO'] = urllib.unquote(rest)
         if query:
@@ -181,7 +181,7 @@
    instance home is the directory that was identified when you did
    "roundup-admin init". You may specify any number of these name=home
    pairs on the command-line. For convenience, you may edit the
-   ROUNDUP_INSTANCE_HOMES variable in the roundup-server file instead.
+   TRACKER_HOMES variable in the roundup-server file instead.
 ''')%locals()
     sys.exit(0)
 
@@ -269,7 +269,7 @@
                 except ValueError:
                     raise ValueError, _("Instances must be name=home")
                 d[name] = home
-            RoundupRequestHandler.ROUNDUP_INSTANCE_HOMES = d
+            RoundupRequestHandler.TRACKER_HOMES = d
     except SystemExit:
         raise
     except:

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