diff options
-rw-r--r-- | .be/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values | 7 | ||||
-rw-r--r-- | .be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values | 49 | ||||
-rw-r--r-- | .be/bugs/42716dc2-6201-4537-b5fd-e1280812a53d/values | 49 | ||||
-rw-r--r-- | .be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values | 7 | ||||
-rw-r--r-- | .be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values | 7 | ||||
-rw-r--r-- | .be/bugs/55e76f74-37fb-4254-8498-54b703ba54f6/values | 9 | ||||
-rw-r--r-- | .be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values | 7 | ||||
-rw-r--r-- | .be/bugs/63619cf7-89eb-4e64-91e9-b8a73d2a6c72/values | 7 | ||||
-rw-r--r-- | .be/bugs/700cd3f1-70b6-4887-89a2-c1d039732add/values | 7 | ||||
-rw-r--r-- | .be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values | 49 | ||||
-rw-r--r-- | .be/bugs/9bc14860-b2bb-4442-85ea-0b8e7083457b/values | 49 | ||||
-rw-r--r-- | .be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values | 7 | ||||
-rw-r--r-- | .be/bugs/e22a9048-9a97-41b1-91a2-d4178c674b37/values | 2 | ||||
-rw-r--r-- | .be/bugs/fd96c69d-6f78-4c0c-af6e-e01e9b8516d3/values | 7 | ||||
-rwxr-xr-x | cfbe.py | 81 |
15 files changed, 303 insertions, 41 deletions
diff --git a/.be/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values b/.be/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values index 6c6f695..b911874 100644 --- a/.be/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values +++ b/.be/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values @@ -36,6 +36,13 @@ summary=Humanize empty result pages. +target=beta + + + + + + time=Sat, 31 Jan 2009 03:03:52 +0000 diff --git a/.be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values b/.be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values new file mode 100644 index 0000000..2f9356f --- /dev/null +++ b/.be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values @@ -0,0 +1,49 @@ + + + +assigned=Steve Losh <steve@stevelosh.com> + + + + + + +creator=Steve Losh <steve@stevelosh.com> + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Document the code for the alpha release. + + + + + + +target=alpha + + + + + + +time=Sat, 31 Jan 2009 05:17:34 +0000 + + + diff --git a/.be/bugs/42716dc2-6201-4537-b5fd-e1280812a53d/values b/.be/bugs/42716dc2-6201-4537-b5fd-e1280812a53d/values new file mode 100644 index 0000000..e00f7ba --- /dev/null +++ b/.be/bugs/42716dc2-6201-4537-b5fd-e1280812a53d/values @@ -0,0 +1,49 @@ + + + +assigned=Steve Losh <steve@stevelosh.com> + + + + + + +creator=Steve Losh <steve@stevelosh.com> + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Document the packaging and install. + + + + + + +target=alpha + + + + + + +time=Sat, 31 Jan 2009 05:17:45 +0000 + + + diff --git a/.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values b/.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values index 0089037..7361121 100644 --- a/.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values +++ b/.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values @@ -36,6 +36,13 @@ summary=Implement viewing of a single bug (with comments). +target=alpha + + + + + + time=Sat, 31 Jan 2009 02:59:28 +0000 diff --git a/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values b/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values index a58e144..8ed8ba9 100644 --- a/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values +++ b/.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values @@ -36,6 +36,13 @@ summary=Implement bug updating (not comments. +target=alpha + + + + + + time=Sat, 31 Jan 2009 02:59:54 +0000 diff --git a/.be/bugs/55e76f74-37fb-4254-8498-54b703ba54f6/values b/.be/bugs/55e76f74-37fb-4254-8498-54b703ba54f6/values index 8656037..cded1dc 100644 --- a/.be/bugs/55e76f74-37fb-4254-8498-54b703ba54f6/values +++ b/.be/bugs/55e76f74-37fb-4254-8498-54b703ba54f6/values @@ -22,7 +22,7 @@ severity=minor -status=open +status=closed @@ -36,6 +36,13 @@ summary=Fix the footer width. +target=alpha + + + + + + time=Sat, 31 Jan 2009 03:01:09 +0000 diff --git a/.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values b/.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values index 0480571..d9d9aed 100644 --- a/.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values +++ b/.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values @@ -36,6 +36,13 @@ summary=Figure out how to best fix the column widths. +target=alpha + + + + + + time=Sat, 31 Jan 2009 03:07:32 +0000 diff --git a/.be/bugs/63619cf7-89eb-4e64-91e9-b8a73d2a6c72/values b/.be/bugs/63619cf7-89eb-4e64-91e9-b8a73d2a6c72/values index c4cac4f..cb7a38e 100644 --- a/.be/bugs/63619cf7-89eb-4e64-91e9-b8a73d2a6c72/values +++ b/.be/bugs/63619cf7-89eb-4e64-91e9-b8a73d2a6c72/values @@ -36,6 +36,13 @@ summary=Implement sorting. +target=beta + + + + + + time=Sat, 31 Jan 2009 02:59:11 +0000 diff --git a/.be/bugs/700cd3f1-70b6-4887-89a2-c1d039732add/values b/.be/bugs/700cd3f1-70b6-4887-89a2-c1d039732add/values index 614e755..71ab0a3 100644 --- a/.be/bugs/700cd3f1-70b6-4887-89a2-c1d039732add/values +++ b/.be/bugs/700cd3f1-70b6-4887-89a2-c1d039732add/values @@ -36,6 +36,13 @@ summary=Implement pagination. +target=beta + + + + + + time=Sat, 31 Jan 2009 03:00:35 +0000 diff --git a/.be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values b/.be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values new file mode 100644 index 0000000..2086515 --- /dev/null +++ b/.be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values @@ -0,0 +1,49 @@ + + + +assigned=Steve Losh <steve@stevelosh.com> + + + + + + +creator=Steve Losh <steve@stevelosh.com> + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Refine graphic design for the alpha version. + + + + + + +target=alpha + + + + + + +time=Sat, 31 Jan 2009 05:17:08 +0000 + + + diff --git a/.be/bugs/9bc14860-b2bb-4442-85ea-0b8e7083457b/values b/.be/bugs/9bc14860-b2bb-4442-85ea-0b8e7083457b/values new file mode 100644 index 0000000..a723a18 --- /dev/null +++ b/.be/bugs/9bc14860-b2bb-4442-85ea-0b8e7083457b/values @@ -0,0 +1,49 @@ + + + +assigned=Steve Losh <steve@stevelosh.com> + + + + + + +creator=Steve Losh <steve@stevelosh.com> + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Create a project page. + + + + + + +target=alpha + + + + + + +time=Sat, 31 Jan 2009 05:18:56 +0000 + + + diff --git a/.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values b/.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values index 247fd7d..4f93cc7 100644 --- a/.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values +++ b/.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values @@ -36,6 +36,13 @@ summary=Implement bug creation. +target=alpha + + + + + + time=Sat, 31 Jan 2009 02:59:35 +0000 diff --git a/.be/bugs/e22a9048-9a97-41b1-91a2-d4178c674b37/values b/.be/bugs/e22a9048-9a97-41b1-91a2-d4178c674b37/values index 4a25de6..63e9e8c 100644 --- a/.be/bugs/e22a9048-9a97-41b1-91a2-d4178c674b37/values +++ b/.be/bugs/e22a9048-9a97-41b1-91a2-d4178c674b37/values @@ -22,7 +22,7 @@ severity=minor -status=open +status=unconfirmed diff --git a/.be/bugs/fd96c69d-6f78-4c0c-af6e-e01e9b8516d3/values b/.be/bugs/fd96c69d-6f78-4c0c-af6e-e01e9b8516d3/values index dcc2e84..0b2bea5 100644 --- a/.be/bugs/fd96c69d-6f78-4c0c-af6e-e01e9b8516d3/values +++ b/.be/bugs/fd96c69d-6f78-4c0c-af6e-e01e9b8516d3/values @@ -36,6 +36,13 @@ summary=Implement adding comments. +target=alpha + + + + + + time=Sat, 31 Jan 2009 03:00:08 +0000 @@ -4,10 +4,6 @@ import cherrypy from libbe import bugdir from jinja2 import Environment, FileSystemLoader -bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be' -bd = bugdir.BugDir(root=bug_root) -bd.load_all_bugs() -repository_name = bd.root.split('/')[-1] template_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/templates' env = Environment(loader=FileSystemLoader(template_root)) @@ -15,9 +11,39 @@ env = Environment(loader=FileSystemLoader(template_root)) class WebInterface: """The web interface to CFBE.""" + def __init__(self, bug_root): + """Initialize the bug repository for this web interface.""" + self.bug_root = bug_root + self.bd = bugdir.BugDir(root=self.bug_root) + self.repository_name = self.bd.root.split('/')[-1] + + def get_common_information(self, assignee, target): + possible_assignees = list(set([bug.assigned for bug in self.bd if bug.assigned != None])) + possible_assignees.sort(key=unicode.lower) + + possible_targets = list(set([bug.target for bug in self.bd if bug.target != None])) + possible_targets.sort(key=unicode.lower) + + return {'possible_assignees': possible_assignees, + 'possible_targets': possible_targets,} + + def filter_bugs(self, status, assignee, target): + """Filter the list of bugs to return only those desired.""" + bugs = [bug for bug in self.bd if bug.status in status] + + if assignee != '': + assignee = None if assignee == 'None' else assignee + bugs = [bug for bug in bugs if bug.assigned == assignee] + + if target != '': + target = None if target == 'None' else target + bugs = [bug for bug in bugs if bug.target == target] + + return bugs + @cherrypy.expose def index(self, status='open', assignee='', target=''): - bd.load_all_bugs() + self.bd.load_all_bugs() if status == 'open': status = ['open', 'assigned', 'test', 'unconfirmed', 'wishlist'] @@ -25,45 +51,22 @@ class WebInterface: elif status == 'closed': status = ['closed', 'disabled', 'fixed', 'wontfix'] label = 'All Closed Bugs' - - if assignee != '': - if assignee == 'None': - label += ' Currently Unassigned' - else: - label += ' Assigned to %s' % (assignee,) + if assignee != '': + label += ' Currently Unassigned' if assignee == 'None' else ' Assigned to %s' % (assignee,) if target != '': - if target == 'None': - label += ' Currently Unschdeuled' - else: - label += ' Scheduled for %s' % (target,) - + label += ' Currently Unschdeuled' if target == 'None' else ' Scheduled for %s' % (target,) template = env.get_template('list.html') + bugs = self.filter_bugs(status, assignee, target) - possible_assignees = list(set([bug.assigned for bug in bd if bug.assigned != None])) - possible_assignees.sort(key=unicode.lower) - - possible_targets = list(set([bug.target for bug in bd if bug.target != None])) - possible_targets.sort(key=unicode.lower) - - bugs = [bug for bug in bd if bug.status in status] - - if assignee != '': - if assignee == 'None': - assignee = None - bugs = [bug for bug in bugs if bug.assigned == assignee] - - if target != '': - if target == 'None': - target = None - bugs = [bug for bug in bugs if bug.target == target] - - return template.render(bugs=bugs, bd=bd, label=label, - assignees=possible_assignees, - targets=possible_targets, - repository_name=repository_name) + common_info = self.get_common_information(assignee, target) + return template.render(bugs=bugs, bd=self.bd, label=label, + assignees=common_info['possible_assignees'], + targets=common_info['possible_targets'], + repository_name=self.repository_name) config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config' -cherrypy.quickstart(WebInterface(), '/', config) +bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be' +cherrypy.quickstart(WebInterface(bug_root), '/', config) |