PageRenderTime 32ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/circuits/web/constants.py

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