- page = error_document_template % \
- dict(prefix=request.environ.get('SCRIPT_NAME', ''),
- code=cgi.escape(request.GET.get('code', resp.status)),
- message=cgi.escape(request.GET.get('message', resp.body)))
- return page
-
- def img(self, id):
- """Serve Pylons' stock images"""
- return self._serve_file(os.path.join(media_path, 'img'), id)
-
- def style(self, id):
- """Serve Pylons' stock stylesheets"""
- return self._serve_file(os.path.join(media_path, 'style'), id)
-
- def _serve_file(self, root, path):
- """Call Paste's FileApp (a WSGI application) to serve the file
- at the specified path
- """
- static = StaticURLParser(root)
- request.environ['PATH_INFO'] = '/%s' % path
- return static(request.environ, self.start_response)
+ c.code = cgi.escape(request.GET.get('code', resp.status))
+ return render('/error.mako')