File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1717
1818"""Command-line script that runs a server over roundup.cgi.client.
1919
20- $Id: roundup_server.py,v 1.74.2.2 2005-01-15 06:53:00 richard Exp $
20+ $Id: roundup_server.py,v 1.74.2.3 2005-02-19 10:14:16 a1s Exp $
2121"""
2222__docformat__ = 'restructuredtext'
2323
@@ -133,13 +133,17 @@ def run_cgi(self):
133133 def index (self ):
134134 ''' Print up an index of the available trackers
135135 '''
136- self .send_response (200 )
136+ keys = self .TRACKER_HOMES .keys ()
137+ if len (keys ) == 1 :
138+ self .send_response (302 )
139+ self .send_header ('Location' , urllib .quote (keys [0 ]) + '/index' )
140+ else :
141+ self .send_response (200 )
137142 self .send_header ('Content-Type' , 'text/html' )
138143 self .end_headers ()
139144 w = self .wfile .write
140145 w (_ ('<html><head><title>Roundup trackers index</title></head>\n '
141146 '<body><h1>Roundup trackers index</h1><ol>\n ' ))
142- keys = self .TRACKER_HOMES .keys ()
143147 keys .sort ()
144148 for tracker in keys :
145149 w ('<li><a href="%(tracker_url)s/index">%(tracker_name)s</a>\n ' % {
You can’t perform that action at this time.
0 commit comments