aboutsummaryrefslogtreecommitdiffstats
path: root/cfbe.py
diff options
context:
space:
mode:
authorSteve Losh <steve@stevelosh.com>2009-01-30 21:45:15 -0500
committerSteve Losh <steve@stevelosh.com>2009-01-30 21:45:15 -0500
commit4cd9b7a520a4902267be73b03b24435ab2923d26 (patch)
treebf00c6959a36ffb41112655f5a3a9e43431f10e3 /cfbe.py
parent4096632287d468c98d7f808079a3f877e7f55fda (diff)
downloadbugseverywhere-4cd9b7a520a4902267be73b03b24435ab2923d26.tar.gz
Made it prettier, and added assignee filters.
Diffstat (limited to 'cfbe.py')
-rwxr-xr-xcfbe.py28
1 files changed, 23 insertions, 5 deletions
diff --git a/cfbe.py b/cfbe.py
index 1628fa6..49fc515 100755
--- a/cfbe.py
+++ b/cfbe.py
@@ -4,7 +4,7 @@ import cherrypy
from libbe import bugdir
from jinja2 import Environment, FileSystemLoader
-bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be'
+bug_root = '/Users/sjl/Desktop/be/.be'
bd = bugdir.BugDir(root=bug_root)
bd.load_all_bugs()
@@ -15,17 +15,35 @@ class WebInterface:
"""The web interface to CFBE."""
@cherrypy.expose
- def index(self, status='open'):
+ def index(self, status='open', assignee=''):
bd.load_all_bugs()
if status == 'open':
status = ['open', 'assigned', 'test', 'unconfirmed', 'wishlist']
- label = 'Open'
+ label = 'All Open Bugs'
elif status == 'closed':
status = ['closed', 'disabled', 'fixed', 'wontfix']
- label = 'Closed'
+ label = 'All Closed Bugs'
+ if assignee != '':
+ if assignee == 'None':
+ label += ' Currently Unassigned'
+ else:
+ label += ' Assigned to %s' % (assignee,)
+
+
template = env.get_template('list.html')
+
+ possible_assignees = list(set([bug.assigned for bug in bd if bug.assigned != None]))
+ possible_assignees.sort(key=unicode.lower)
+
bugs = [bug for bug in bd if bug.status in status]
- return template.render(bugs=bugs, bd=bd, label=label)
+
+ if assignee != '':
+ if assignee == 'None':
+ assignee = None
+ bugs = [bug for bug in bugs if bug.assigned == assignee]
+
+ return template.render(bugs=bugs, bd=bd, label=label,
+ assignees=possible_assignees)
config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config'