Code

- nicer display of tracker list in roundup-server (sf bug 619769)
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Tue, 8 Oct 2002 03:31:09 +0000 (03:31 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Tue, 8 Oct 2002 03:31:09 +0000 (03:31 +0000)
- fixed some missed renaming instance -> tracker (sf bug 619769)

git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1324 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
cgi-bin/roundup.cgi
roundup/scripts/roundup_server.py

index d9f3fc9a5c84f1fa27c4e20e4f9f5112fd19d035..665dd3546033e54a99358f3da605b5aa4b4bf83b 100644 (file)
@@ -11,6 +11,8 @@ are given with the most recent entry first.
 - fixed log / pid file path handling in roundup-server (sf bug 617981)
 - fixed old gadfly compatibiltiy problem, for sure this time (sf bug 612873)
 - https URLs from config now recognised as valid (sf bug 619829)
+- nicer display of tracker list in roundup-server (sf bug 619769)
+- fixed some missed renaming instance -> tracker (sf bug 619769)
 
 
 2002-10-02 0.5.0
index 1518c400b98111965ddeb1bc662dddc9103afc2b..22cf5cf817cf8d1444afbddbf11a9b94bb536b21 100755 (executable)
@@ -16,7 +16,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: roundup.cgi,v 1.33 2002-09-23 00:50:32 richard Exp $
+# $Id: roundup.cgi,v 1.34 2002-10-08 03:31:09 richard Exp $
 
 # python version check
 from roundup import version_check
@@ -32,7 +32,7 @@ import sys
 # documented below are set, they _override_ any configuation defaults
 # given in this file. 
 
-# TRACKER_HOMES is a list of instances, in the form
+# TRACKER_HOMES is a list of trackers, in the form
 # "NAME=DIR<sep>NAME2=DIR2<sep>...", where <sep> is the directory path
 # separator (";" on Windows, ":" on Unix). 
 
@@ -45,9 +45,9 @@ import sys
 # ROUNDUP_DEBUG is a debug level, currently only 0 (OFF) and 1 (ON) are
 # used in the code. Higher numbers means more debugging output. 
 
-# This indicates where the Roundup instance lives
+# This indicates where the Roundup tracker lives
 TRACKER_HOMES = {
-    'demo': '/var/roundup/instances/demo',
+    'demo': '/var/roundup/trackers/demo',
 }
 
 # Where to log debugging information to. Use an instance of DevNull if you
@@ -136,10 +136,10 @@ def main(out, err):
     path = string.split(os.environ.get('PATH_INFO', '/'), '/')
     request = RequestWrapper(out)
     request.path = os.environ.get('PATH_INFO', '/')
-    instance = path[1]
-    os.environ['TRACKER_NAME'] = instance
+    tracker = path[1]
+    os.environ['TRACKER_NAME'] = tracker
     os.environ['PATH_INFO'] = string.join(path[2:], '/')
-    if TRACKER_HOMES.has_key(instance):
+    if TRACKER_HOMES.has_key(tracker):
         # redirect if we need a trailing '/'
         if len(path) == 2:
             request.send_response(301)
@@ -154,10 +154,10 @@ def main(out, err):
             request.end_headers()
             out.write('Moved Permanently')
         else:
-            instance_home = TRACKER_HOMES[instance]
-            instance = roundup.instance.open(instance_home)
+            tracker_home = TRACKER_HOMES[tracker]
+            tracker = roundup.instance.open(tracker_home)
             from roundup.cgi.client import Unauthorised, NotFound
-            client = instance.Client(instance, request, os.environ)
+            client = tracker.Client(tracker, request, os.environ)
             try:
                 client.main()
             except Unauthorised:
@@ -177,14 +177,15 @@ def main(out, err):
         request.send_header('Content-Type', 'text/html')
         request.end_headers()
         w = request.write
-        w(_('<html><head><title>Roundup instances index</title></head>\n'))
-        w(_('<body><h1>Roundup instances index</h1><ol>\n'))
+        w(_('<html><head><title>Roundup trackers index</title></head>\n'))
+        w(_('<body><h1>Roundup trackers index</h1><ol>\n'))
         homes = TRACKER_HOMES.keys()
         homes.sort()
-        for instance in homes:
-            w(_('<li><a href="%(instance_url)s/index">%(instance_name)s</a>\n')%{
-                'instance_url': os.environ['SCRIPT_NAME']+'/'+urllib.quote(instance),
-                'instance_name': cgi.escape(instance)})
+        for tracker in homes:
+            w(_('<li><a href="%(tracker_url)s/index">%(tracker_name)s</a>\n')%{
+                'tracker_url': os.environ['SCRIPT_NAME']+'/'+
+                               urllib.quote(tracker),
+                'tracker_name': cgi.escape(tracker)})
         w(_('</ol></body></html>'))
 
 #
index 86f8444a6d8ae8d2d02f72633d7aff8831f4905a..4f4b213f65dc52a7f21ad96a51c7a0e9bbc9fced 100644 (file)
@@ -16,7 +16,7 @@
 # 
 """ HTTP Server that serves roundup.
 
-$Id: roundup_server.py,v 1.13 2002-10-07 00:52:51 richard Exp $
+$Id: roundup_server.py,v 1.14 2002-10-08 03:31:09 richard Exp $
 """
 
 # python version check
@@ -96,18 +96,20 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
     do_GET = do_POST = do_HEAD = send_head = run_cgi
 
     def index(self):
-        ''' Print up an index of the available instances
+        ''' Print up an index of the available trackers
         '''
         self.send_response(200)
         self.send_header('Content-Type', 'text/html')
         self.end_headers()
         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.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)})
+        w(_('<html><head><title>Roundup trackers index</title></head>\n'))
+        w(_('<body><h1>Roundup trackers index</h1><ol>\n'))
+        keys = self.TRACKER_HOMES.keys()
+        keys.sort()
+        for tracker in keys:
+            w(_('<li><a href="%(tracker_url)s/index">%(tracker_name)s</a>\n')%{
+                'tracker_url': urllib.quote(tracker),
+                'tracker_name': cgi.escape(tracker)})
         w(_('</ol></body></html>'))
 
     def inner_run_cgi(self):
@@ -121,14 +123,14 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
         else:
             query = ''
 
-        # figure the instance
+        # figure the tracker
         if rest == '/':
             return self.index()
         l_path = rest.split('/')
-        instance_name = urllib.unquote(l_path[1])
-        if self.TRACKER_HOMES.has_key(instance_name):
-            instance_home = self.TRACKER_HOMES[instance_name]
-            instance = roundup.instance.open(instance_home)
+        tracker_name = urllib.unquote(l_path[1])
+        if self.TRACKER_HOMES.has_key(tracker_name):
+            tracker_home = self.TRACKER_HOMES[tracker_name]
+            tracker = roundup.instance.open(tracker_home)
         else:
             raise client.NotFound
 
@@ -140,7 +142,7 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
 
         # Set up the CGI environment
         env = {}
-        env['TRACKER_NAME'] = instance_name
+        env['TRACKER_NAME'] = tracker_name
         env['REQUEST_METHOD'] = self.command
         env['PATH_INFO'] = urllib.unquote(rest)
         if query:
@@ -164,24 +166,24 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
         decoded_query = query.replace('+', ' ')
 
         # do the roundup thang
-        c = instance.Client(instance, self, env)
+        c = tracker.Client(tracker, self, env)
         c.main()
 
 def usage(message=''):
     if message:
         message = _('Error: %(error)s\n\n')%{'error': message}
     print _('''%(message)sUsage:
-roundup-server [-n hostname] [-p port] [-l file] [-d file] [name=instance home]*
+roundup-server [-n hostname] [-p port] [-l file] [-d file] [name=tracker home]*
 
  -n: sets the host name
  -p: sets the port to listen on
  -l: sets a filename to log to (instead of stdout)
  -d: daemonize, and write the server's PID to the nominated file
 
- name=instance home
-   Sets the instance home(s) to use. The name is how the instance is
+ name=tracker home
+   Sets the tracker home(s) to use. The name is how the tracker is
    identified in the URL (it's the first part of the URL path). The
-   instance home is the directory that was identified when you did
+   tracker 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
    TRACKER_HOMES variable in the roundup-server file instead.
@@ -276,7 +278,7 @@ def run():
             if not os.getuid() and user is None:
                 raise ValueError, _("Can't run as root!")
 
-        # handle instance specs
+        # handle tracker specs
         if args:
             d = {}
             for arg in args: