import turbogears
from turbogears import controllers
import cherrypy
-from libbe.bugdir import tree_root, cmp_severity, new_bug, new_comment
+from libbe.bugdir import (tree_root, cmp_severity, new_bug, new_comment,
+ NoRootEntry)
from libbe import names
from config import projects
from prest import PrestHandler, provide_action
@turbogears.expose()
def index(self):
raise cherrypy.HTTPRedirect(project_url())
+
+ @turbogears.expose('beweb.templates.about')
+ def about(self, *paths, **kwargs):
+ return {}
+
@turbogears.expose()
def default(self, *args, **kwargs):
return self.prest.default(*args, **kwargs)
+
+ def _cpOnError(self):
+ import traceback, StringIO
+ bodyFile = StringIO.StringIO()
+ traceback.print_exc(file = bodyFile)
+ trace_text = bodyFile.getvalue()
+ try:
+ raise
+ except cherrypy.NotFound:
+ self.handle_error('Not Found', str(e), trace_text, '404 Not Found')
+
+ except NoRootEntry, e:
+ self.handle_error('Project Misconfiguration', str(e), trace_text)
+
+ except Exception, e:
+ self.handle_error('Internal server error', str(e), trace_text)
+
+ def handle_error(self, heading, body, traceback=None,
+ status='500 Internal Server Error'):
+ cherrypy.response.headerMap['Status'] = status
+ cherrypy.response.body = [self.errorpage(heading, body, traceback)]
+
+
+ @turbogears.expose(html='beweb.templates.error')
+ def errorpage(self, heading, body, traceback):
+ return {'heading': heading, 'body': body, 'traceback': traceback}
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
+ py:extends="'master.kid'">
+<head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
+ <title>About Bugs Everywhere</title>
+</head>
+
+<body>
+<h1>About Bugs Everywhere</h1>
+<p>Bug Everywhere was designed by Aaron Bentley and implemented by Aaron
+ Bentley and Oleg Romanyshyn.
+</p>
+<p>
+ Some of its development was sponsored by
+ <a href="http://panoramicfeedback.com/">Panoramic Feedback</a>
+</p>
+<a href="/">Project List</a>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
+ py:extends="'master.kid'">
+<head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
+ <title>BE Error: ${heading}</title>
+</head>
+
+<body>
+<h1 py:content="heading">Error heading</h1>
+<div py:replace="body" >Error Body</div>
+<pre py:content="traceback" class="traceback">Traceback</pre>
+</body>
+</html>
</head>
<body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'">
-<div id="header">b u g s e v r y w h e r e</div>
+<div id="header"><div style="float: left">b u g s e v r y w h e r e</div><ul class="navoption"><li><a href="/about/">About</a></li></ul> </div>
<div py:if="tg_flash" class="flash" py:content="tg_flash"></div>
<div py:replace="item[:]"/>
</body>
-<table py:match="item.tag=='{http://www.w3.org/1999/xhtml}insetbox'" cellspacing="0" cellpadding="0" border="0" class="insetbox">
+<table py:match="item.tag=='{http://www.w3.org/1999/xhtml}insetbox'" ellspacing="0" cellpadding="0" border="0" class="insetbox">
<tr height="19"><td background="/static/images/is-tl.png" width="19"/>
<td background="/static/images/is-t.png" />
<td background="/static/images/is-tr.png" width="11"></td>