|
16 | 16 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
17 | 17 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
18 | 18 | # |
19 | | -# $Id: roundup.cgi,v 1.26 2002-09-04 01:58:33 richard Exp $ |
| 19 | +# $Id: roundup.cgi,v 1.27 2002-09-04 02:11:00 richard Exp $ |
20 | 20 |
|
21 | 21 | # python version check |
22 | 22 | from roundup import version_check |
@@ -142,20 +142,20 @@ def main(out, err): |
142 | 142 | else: |
143 | 143 | instance_home = ROUNDUP_INSTANCE_HOMES[instance] |
144 | 144 | instance = roundup.instance.open(instance_home) |
145 | | - from roundup.cgi import client |
146 | | - c = instance.Client(instance, request, os.environ) |
| 145 | + from roundup.cgi.client import Unauthorised, NotFound |
| 146 | + client = instance.Client(instance, request, os.environ) |
147 | 147 | try: |
148 | | - c.main() |
149 | | - except client.Unauthorised: |
| 148 | + client.main() |
| 149 | + except Unauthorised: |
150 | 150 | request.send_response(403) |
151 | 151 | request.send_header('Content-Type', 'text/html') |
152 | 152 | request.end_headers() |
153 | 153 | out.write('Unauthorised') |
154 | | - except client.NotFound: |
| 154 | + except NotFound: |
155 | 155 | request.send_response(404) |
156 | 156 | request.send_header('Content-Type', 'text/html') |
157 | 157 | request.end_headers() |
158 | | - out.write('Not found: %s'%c.path) |
| 158 | + out.write('Not found: %s'%client.path) |
159 | 159 |
|
160 | 160 | else: |
161 | 161 | import urllib |
@@ -198,6 +198,9 @@ LOG.close() |
198 | 198 |
|
199 | 199 | # |
200 | 200 | # $Log: not supported by cvs2svn $ |
| 201 | +# Revision 1.26 2002/09/04 01:58:33 richard |
| 202 | +# fix cgi client importing |
| 203 | +# |
201 | 204 | # Revision 1.25 2002/08/22 00:14:18 richard |
202 | 205 | # Fix to be able to report errors even if the cgi module can't be imported(!) |
203 | 206 | # |
|
0 commit comments