/circuits/web/constants.py
Python | 98 lines | 87 code | 4 blank | 7 comment | 0 complexity | d57a29a2a861e1ec75ca3778a97bd7b3 MD5 | raw file
1# Module: constants 2# Date: 4th February 2009 3# Author: James Mills, prologic at shortcircuit dot net dot au 4 5"""Global Constants 6 7This module implements required shared global constants. 8""" 9 10from circuits import __version__ 11 12SERVER_PROTOCOL = (1, 1) 13SERVER_VERSION = "circuits.web/%s" % __version__ 14SERVER_URL = "http://circuitsweb.com/" 15 16DEFAULT_ERROR_MESSAGE = """\ 17<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 18"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 19<html> 20 <head> 21 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta> 22 <title>%(code)d %(name)s</title> 23 <style type="text/css"> 24 #powered_by { 25 margin-top: 20px; 26 border-top: 2px solid black; 27 font-style: italic; 28 } 29 30 #traceback { 31 color: red; 32 } 33 </style> 34 </head> 35 <body> 36 <h1>%(name)s</h1> 37 %(description)s 38 <pre id="traceback">%(traceback)s</pre> 39 <div id="powered_by"> 40 <span>Powered by <a href="%(url)s">%(version)s</a></span> 41 </div> 42 </body> 43</html> 44""" 45 46HTTP_STATUS_CODES = { 47 100: "Continue", 48 101: "Switching Protocols", 49 102: "Processing", 50 200: "OK", 51 201: "Created", 52 202: "Accepted", 53 203: "Non Authoritative Information", 54 204: "No Content", 55 205: "Reset Content", 56 206: "Partial Content", 57 207: "Multi Status", 58 226: "IM Used", 59 300: "Multiple Choices", 60 301: "Moved Permanently", 61 302: "Found", 62 303: "See Other", 63 304: "Not Modified", 64 305: "Use Proxy", 65 307: "Temporary Redirect", 66 400: "Bad Request", 67 401: "Unauthorized", 68 402: "Payment Required", 69 403: "Forbidden", 70 404: "Not Found", 71 405: "Method Not Allowed", 72 406: "Not Acceptable", 73 407: "Proxy Authentication Required", 74 408: "Request Timeout", 75 409: "Conflict", 76 410: "Gone", 77 411: "Length Required", 78 412: "Precondition Failed", 79 413: "Request Entity Too Large", 80 414: "Request URI Too Long", 81 415: "Unsupported Media Type", 82 416: "Requested Range Not Satisfiable", 83 417: "Expectation Failed", 84 418: "I\"m a teapot", 85 422: "Unprocessable Entity", 86 423: "Locked", 87 424: "Failed Dependency", 88 426: "Upgrade Required", 89 449: "Retry With", 90 500: "Internal Server Error", 91 501: "Not Implemented", 92 502: "Bad Gateway", 93 503: "Service Unavailable", 94 504: "Gateway Timeout", 95 505: "HTTP Version Not Supported", 96 507: "Insufficient Storage", 97 510: "Not Extended" 98}