[Mpuls-commits] r1247 - in wasko/branches/2.0: mpulsweb/controllers waskaweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 4 15:44:11 CET 2010


Author: torsten
Date: 2010-02-04 15:44:11 +0100 (Thu, 04 Feb 2010)
New Revision: 1247

Added:
   wasko/branches/2.0/mpulsweb/controllers/error.py
Removed:
   wasko/branches/2.0/waskaweb/controllers/error.py
Log:
Moved controller/error.py
* waskaweb/controllers/error.py,
  mpulsweb/controllers/error.py: Moved and adopted import


Copied: wasko/branches/2.0/mpulsweb/controllers/error.py (from rev 1240, wasko/branches/2.0/waskaweb/controllers/error.py)
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/error.py	2010-02-04 11:42:52 UTC (rev 1240)
+++ wasko/branches/2.0/mpulsweb/controllers/error.py	2010-02-04 14:44:11 UTC (rev 1247)
@@ -0,0 +1,46 @@
+import cgi
+
+from paste.urlparser import PkgResourcesParser
+from pylons import request
+from pylons.controllers.util import forward
+from pylons.middleware import error_document_template
+from webhelpers.html.builder import literal
+
+from mpulsweb.lib.base import BaseController
+
+class ErrorController(BaseController):
+
+    """Generates error documents as and when they are required.
+
+    The ErrorDocuments middleware forwards to ErrorController when error
+    related status codes are returned from the application.
+
+    This behaviour can be altered by changing the parameters to the
+    ErrorDocuments middleware in your config/middleware.py file.
+
+    """
+
+    def document(self):
+        """Render the error document"""
+        resp = request.environ.get('pylons.original_response')
+        content = literal(resp.body) or cgi.escape(request.GET.get('message', ''))
+        page = error_document_template % \
+            dict(prefix=request.environ.get('SCRIPT_NAME', ''),
+                 code=cgi.escape(request.GET.get('code', str(resp.status_int))),
+                 message=content)
+        return page
+
+    def img(self, id):
+        """Serve Pylons' stock images"""
+        return self._serve_file('/'.join(['media/img', id]))
+
+    def style(self, id):
+        """Serve Pylons' stock stylesheets"""
+        return self._serve_file('/'.join(['media/style', id]))
+
+    def _serve_file(self, path):
+        """Call Paste's FileApp (a WSGI application) to serve the file
+        at the specified path
+        """
+        request.environ['PATH_INFO'] = '/%s' % path
+        return forward(PkgResourcesParser('pylons', 'pylons'))


Property changes on: wasko/branches/2.0/mpulsweb/controllers/error.py
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: wasko/branches/2.0/waskaweb/controllers/error.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/error.py	2010-02-04 14:41:13 UTC (rev 1246)
+++ wasko/branches/2.0/waskaweb/controllers/error.py	2010-02-04 14:44:11 UTC (rev 1247)
@@ -1,46 +0,0 @@
-import cgi
-
-from paste.urlparser import PkgResourcesParser
-from pylons import request
-from pylons.controllers.util import forward
-from pylons.middleware import error_document_template
-from webhelpers.html.builder import literal
-
-from waskaweb.lib.base import BaseController
-
-class ErrorController(BaseController):
-
-    """Generates error documents as and when they are required.
-
-    The ErrorDocuments middleware forwards to ErrorController when error
-    related status codes are returned from the application.
-
-    This behaviour can be altered by changing the parameters to the
-    ErrorDocuments middleware in your config/middleware.py file.
-
-    """
-
-    def document(self):
-        """Render the error document"""
-        resp = request.environ.get('pylons.original_response')
-        content = literal(resp.body) or cgi.escape(request.GET.get('message', ''))
-        page = error_document_template % \
-            dict(prefix=request.environ.get('SCRIPT_NAME', ''),
-                 code=cgi.escape(request.GET.get('code', str(resp.status_int))),
-                 message=content)
-        return page
-
-    def img(self, id):
-        """Serve Pylons' stock images"""
-        return self._serve_file('/'.join(['media/img', id]))
-
-    def style(self, id):
-        """Serve Pylons' stock stylesheets"""
-        return self._serve_file('/'.join(['media/style', id]))
-
-    def _serve_file(self, path):
-        """Call Paste's FileApp (a WSGI application) to serve the file
-        at the specified path
-        """
-        request.environ['PATH_INFO'] = '/%s' % path
-        return forward(PkgResourcesParser('pylons', 'pylons'))



More information about the Mpuls-commits mailing list