Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: third_party/twisted_8_1/twisted/web/error.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/twisted_8_1/twisted/web/domhelpers.py ('k') | third_party/twisted_8_1/twisted/web/google.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/twisted_8_1/twisted/web/error.py
diff --git a/third_party/twisted_8_1/twisted/web/error.py b/third_party/twisted_8_1/twisted/web/error.py
deleted file mode 100644
index 737f1f586806c718eabf5961b9d8dd24d2a06d96..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/web/error.py
+++ /dev/null
@@ -1,61 +0,0 @@
-
-# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-
-"""I am the Twisted.Web error resources and exceptions."""
-
-#t.w imports
-import resource
-
-from twisted.web import http
-
-class Error(Exception):
- def __init__(self, code, message = None, response = None):
- message = message or http.responses.get(code)
- Exception.__init__(self, code, message, response)
- self.status = code
- self.response = response
-
- def __str__(self):
- return '%s %s' % (self[0], self[1])
-
-class PageRedirect(Error):
- """A request that resulted in a http redirect """
- def __init__(self, code, message = None, response = None, location = None):
- message = message or ("%s to %s" % (http.responses.get(code), location))
- Error.__init__(self, code, message, response)
- self.location = location
-
-class ErrorPage(resource.Resource):
- def __init__(self, status, brief, detail):
- resource.Resource.__init__(self)
- self.code = status
- self.brief = brief
- self.detail = detail
-
- def render(self, request):
- request.setResponseCode(self.code)
- request.setHeader("content-type", "text/html")
- return ("""<html>
- <head><title>%s - %s</title></head>
- <body><h1>%s</h1>
- <p>%s</p>
- </body></html>\n\n""" %
- (self.code, self.brief, self.brief, self.detail))
-
- def getChild(self, chnam, request):
- return self
-
-
-class NoResource(ErrorPage):
- def __init__(self, message="Sorry. No luck finding that resource."):
- ErrorPage.__init__(self, http.NOT_FOUND,
- "No Such Resource",
- message)
-
-class ForbiddenResource(ErrorPage):
- def __init__(self, message="Sorry, resource is forbidden."):
- ErrorPage.__init__(self, http.FORBIDDEN,
- "Forbidden Resource",
- message)
« no previous file with comments | « third_party/twisted_8_1/twisted/web/domhelpers.py ('k') | third_party/twisted_8_1/twisted/web/google.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698