~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:20:19 UTC
  • Revision ID: grantw@unimelb.edu.au-20090624102019-v1s06kakgkookisa
Trim lots of useless HTTP status constants from ivle.dispatch.request.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
 
89
89
    # HTTP status codes
90
90
 
91
 
    HTTP_CONTINUE                     = 100
92
 
    HTTP_SWITCHING_PROTOCOLS          = 101
93
 
    HTTP_PROCESSING                   = 102
94
91
    HTTP_OK                           = 200
95
 
    HTTP_CREATED                      = 201
96
 
    HTTP_ACCEPTED                     = 202
97
 
    HTTP_NON_AUTHORITATIVE            = 203
98
 
    HTTP_NO_CONTENT                   = 204
99
 
    HTTP_RESET_CONTENT                = 205
100
 
    HTTP_PARTIAL_CONTENT              = 206
101
 
    HTTP_MULTI_STATUS                 = 207
102
 
    HTTP_MULTIPLE_CHOICES             = 300
103
 
    HTTP_MOVED_PERMANENTLY            = 301
104
92
    HTTP_MOVED_TEMPORARILY            = 302
105
 
    HTTP_SEE_OTHER                    = 303
106
 
    HTTP_NOT_MODIFIED                 = 304
107
 
    HTTP_USE_PROXY                    = 305
108
 
    HTTP_TEMPORARY_REDIRECT           = 307
109
 
    HTTP_BAD_REQUEST                  = 400
110
 
    HTTP_UNAUTHORIZED                 = 401
111
 
    HTTP_PAYMENT_REQUIRED             = 402
112
93
    HTTP_FORBIDDEN                    = 403
113
94
    HTTP_NOT_FOUND                    = 404
114
 
    HTTP_METHOD_NOT_ALLOWED           = 405
115
 
    HTTP_NOT_ACCEPTABLE               = 406
116
 
    HTTP_PROXY_AUTHENTICATION_REQUIRED= 407
117
 
    HTTP_REQUEST_TIME_OUT             = 408
118
 
    HTTP_CONFLICT                     = 409
119
 
    HTTP_GONE                         = 410
120
 
    HTTP_LENGTH_REQUIRED              = 411
121
 
    HTTP_PRECONDITION_FAILED          = 412
122
 
    HTTP_REQUEST_ENTITY_TOO_LARGE     = 413
123
 
    HTTP_REQUEST_URI_TOO_LARGE        = 414
124
 
    HTTP_UNSUPPORTED_MEDIA_TYPE       = 415
125
 
    HTTP_RANGE_NOT_SATISFIABLE        = 416
126
 
    HTTP_EXPECTATION_FAILED           = 417
127
 
    HTTP_UNPROCESSABLE_ENTITY         = 422
128
 
    HTTP_LOCKED                       = 423
129
 
    HTTP_FAILED_DEPENDENCY            = 424
130
95
    HTTP_INTERNAL_SERVER_ERROR        = 500
131
 
    HTTP_NOT_IMPLEMENTED              = 501
132
 
    HTTP_BAD_GATEWAY                  = 502
133
 
    HTTP_SERVICE_UNAVAILABLE          = 503
134
 
    HTTP_GATEWAY_TIME_OUT             = 504
135
 
    HTTP_VERSION_NOT_SUPPORTED        = 505
136
 
    HTTP_VARIANT_ALSO_VARIES          = 506
137
 
    HTTP_INSUFFICIENT_STORAGE         = 507
138
 
    HTTP_NOT_EXTENDED                 = 510
139
96
 
140
97
    def __init__(self, req, config):
141
98
        """Create an IVLE request from a mod_python one.
346
303
 
347
304
# Human strings for HTTP response codes
348
305
http_codenames = {
349
 
    Request.HTTP_BAD_REQUEST:
350
 
        ("Bad Request",
351
 
        "Your browser sent a request IVLE did not understand."),
352
 
    Request.HTTP_UNAUTHORIZED:
353
 
        ("Unauthorized",
354
 
        "You are not allowed to view this part of IVLE."),
355
306
    Request.HTTP_FORBIDDEN:
356
307
        ("Forbidden",
357
308
        "You are not allowed to view this part of IVLE."),
358
309
    Request.HTTP_NOT_FOUND:
359
310
        ("Not Found",
360
311
        "The application or file you requested does not exist."),
361
 
    Request.HTTP_METHOD_NOT_ALLOWED:
362
 
        ("Method Not Allowed",
363
 
        "Your browser is interacting with IVLE in the wrong way."
364
 
        "This is probably a bug in IVLE. "
365
 
        "Please report it to the administrators."),
366
312
    Request.HTTP_INTERNAL_SERVER_ERROR:
367
313
        ("Internal Server Error",
368
314
        "An unknown error occured in IVLE."),
369
 
    Request.HTTP_NOT_IMPLEMENTED:
370
 
        ("Not Implemented",
371
 
        "The application or file you requested has not been implemented "
372
 
        "in IVLE."),
373
 
    Request.HTTP_SERVICE_UNAVAILABLE:
374
 
        ("Service Unavailable",
375
 
        "IVLE is currently experiencing technical difficulties. "
376
 
        "Please try again later."),
377
315
}