def get_body(self, environ): """Get the HTML body.""" return ( '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n' '<title>%(code)s %(name)s</title>\n' '<h1>Error %(code)s - %(name)s</h1>\n' '<p>%(description)s</p>\n' '<p><pre>%(traceback)s</pre></p>\n' ) % { 'code': self.code, 'name': escape(self.name), 'description': self.get_description(environ), 'traceback': escape(self.get_traceback()), }
def get_description(self, environ): m = escape(environ.get('REQUEST_METHOD', 'GET')) return '<p>The method %s is not allowed for the requested URL.</p>' % m