diff options
author | Steve Losh <steve@stevelosh.com> | 2009-01-29 21:31:29 -0500 |
---|---|---|
committer | Steve Losh <steve@stevelosh.com> | 2009-01-29 21:31:29 -0500 |
commit | 17bd39c87dc4133d4e31ec0fd11e155f3fe209a9 (patch) | |
tree | 10162e97aaf726199ec57e6e155c0102364a6304 | |
parent | 90fdd9601e2450a420564668b01fb6df1287c196 (diff) | |
download | bugseverywhere-17bd39c87dc4133d4e31ec0fd11e155f3fe209a9.tar.gz |
Very basic working skeleton. Gets stuff from the bug directory, renders with Jinja.
-rwxr-xr-x | cfbe.py | 23 | ||||
-rw-r--r-- | templates/base.html | 3 |
2 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,23 @@ +#!/usr/bin/env python + +import cherrypy +from libbe import bugdir +from jinja2 import Environment, FileSystemLoader + +template_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/templates' +bug_root = '/Users/sjl/Documents/stevelosh/.be' +bd = bugdir.BugDir(root=bug_root) +bd.load_all_bugs() + +env = Environment(loader=FileSystemLoader(template_root)) + +class WebInterface: + """The web interface to CFBE.""" + + @cherrypy.expose + def index(self): + template = env.get_template('base.html') + return template.render(bugs=bd) + + +cherrypy.quickstart(WebInterface()) diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..8d873f9 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,3 @@ +{% for bug in bugs %} + <p>{{ bug.summary }}</p> +{% endfor %}
\ No newline at end of file |