Very basic working skeleton. Gets stuff from the bug directory, renders with Jinja.
authorSteve Losh <steve@stevelosh.com>
Fri, 30 Jan 2009 02:31:29 +0000 (21:31 -0500)
committerSteve Losh <steve@stevelosh.com>
Fri, 30 Jan 2009 02:31:29 +0000 (21:31 -0500)
cfbe.py [new file with mode: 0755]
templates/base.html [new file with mode: 0644]

diff --git a/cfbe.py b/cfbe.py
new file mode 100755 (executable)
index 0000000..25a549d
--- /dev/null
+++ b/cfbe.py
@@ -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 (file)
index 0000000..8d873f9
--- /dev/null
@@ -0,0 +1,3 @@
+{% for bug in bugs %}
+    <p>{{ bug.summary }}</p>
+{% endfor %}
\ No newline at end of file