~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/dispatch/request.py

  • Committer: William Grant
  • Date: 2009-06-24 10:38:34 UTC
  • Revision ID: grantw@unimelb.edu.au-20090624103834-28ugknzvpzsrehrn
Drop HTTP codename stuff from Request.

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
            self.got_common_vars = True
289
289
        return self.apache_req.subprocess_env
290
290
 
291
 
    @staticmethod
292
 
    def get_http_codename(code):
293
 
        """Given a HTTP error code int, returns a (name, description)
294
 
        pair, suitable for displaying to the user.
295
 
        May return (None,None) if code is unknown.
296
 
        Only lists common 4xx and 5xx codes (since this is just used
297
 
        to display throw_error error messages).
298
 
        """
299
 
        try:
300
 
            return http_codenames[code]
301
 
        except KeyError:
302
 
            return None, None
303
 
 
304
 
# Human strings for HTTP response codes
305
 
http_codenames = {
306
 
    Request.HTTP_FORBIDDEN:
307
 
        ("Forbidden",
308
 
        "You are not allowed to view this part of IVLE."),
309
 
    Request.HTTP_NOT_FOUND:
310
 
        ("Not Found",
311
 
        "The application or file you requested does not exist."),
312
 
    Request.HTTP_INTERNAL_SERVER_ERROR:
313
 
        ("Internal Server Error",
314
 
        "An unknown error occured in IVLE."),
315
 
}