Fixed a minor filter bug, more bug reports.
authorSteve Losh <steve@stevelosh.com>
Sat, 31 Jan 2009 05:19:57 +0000 (00:19 -0500)
committerSteve Losh <steve@stevelosh.com>
Sat, 31 Jan 2009 05:19:57 +0000 (00:19 -0500)
Starting to plan out the alpha release mroe thoroughly.

15 files changed:
.be/bugs/0a234f51-2fdf-4001-a04f-b7e02c2fa47b/values
.be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values [new file with mode: 0644]
.be/bugs/42716dc2-6201-4537-b5fd-e1280812a53d/values [new file with mode: 0644]
.be/bugs/528b2e84-a944-4628-a18f-cc1def1c7e16/values
.be/bugs/545311df-8c88-4504-9f83-11d7c5d8aa50/values
.be/bugs/55e76f74-37fb-4254-8498-54b703ba54f6/values
.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values
.be/bugs/63619cf7-89eb-4e64-91e9-b8a73d2a6c72/values
.be/bugs/700cd3f1-70b6-4887-89a2-c1d039732add/values
.be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values [new file with mode: 0644]
.be/bugs/9bc14860-b2bb-4442-85ea-0b8e7083457b/values [new file with mode: 0644]
.be/bugs/bef126a0-27be-402f-84fa-85f6342c97c0/values
.be/bugs/e22a9048-9a97-41b1-91a2-d4178c674b37/values
.be/bugs/fd96c69d-6f78-4c0c-af6e-e01e9b8516d3/values
cfbe.py

index 6c6f69598ffa2bbce9b9eade218e1df1e20672c8..b911874a19ab9cfc2881928b955627d57cd8e846 100644 (file)
@@ -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 (file)
index 0000000..2f9356f
--- /dev/null
@@ -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 (file)
index 0000000..e00f7ba
--- /dev/null
@@ -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
+
+
+
index 00890371da256a65db5ab2e651337ad7fbb36f4b..73611219f99bbffde44d0722ecef1e5053f46fad 100644 (file)
@@ -36,6 +36,13 @@ summary=Implement viewing of a single bug (with comments).
 
 
 
+target=alpha
+
+
+
+
+
+
 time=Sat, 31 Jan 2009 02:59:28 +0000
 
 
index a58e14461ffc56ebc8dcc47dd0962e0a8898f6a6..8ed8ba9aa024633b1986102b993f9d3b37d410cd 100644 (file)
@@ -36,6 +36,13 @@ summary=Implement bug updating (not comments.
 
 
 
+target=alpha
+
+
+
+
+
+
 time=Sat, 31 Jan 2009 02:59:54 +0000
 
 
index 86560370abb553fe84a3d7085ade3316685600ac..cded1dc773c459143e3feb3bdbe513bccdb191db 100644 (file)
@@ -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
 
 
index 0480571331cbda368de44ded887f424a4166d58a..d9d9aed56e25b8d9abc7376cc0687f434ae984a7 100644 (file)
@@ -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
 
 
index c4cac4f1a85a8dc0a80c22e8b607ac54690582a8..cb7a38e454baf6f930c4893747c85fe40fa5b09c 100644 (file)
@@ -36,6 +36,13 @@ summary=Implement sorting.
 
 
 
+target=beta
+
+
+
+
+
+
 time=Sat, 31 Jan 2009 02:59:11 +0000
 
 
index 614e7554e1ab1cb81ac3c1ecb1585634f590605f..71ab0a3c2c48ed52c23584bf277e3d72abd71be4 100644 (file)
@@ -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 (file)
index 0000000..2086515
--- /dev/null
@@ -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 (file)
index 0000000..a723a18
--- /dev/null
@@ -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
+
+
+
index 247fd7d3c35b318632d615b484793a9646d6d95d..4f93cc7f3e052f0cc174bb2e224b3e40cf68bc24 100644 (file)
@@ -36,6 +36,13 @@ summary=Implement bug creation.
 
 
 
+target=alpha
+
+
+
+
+
+
 time=Sat, 31 Jan 2009 02:59:35 +0000
 
 
index 4a25de63172553e6df3549754164d5bf2af9ea1a..63e9e8c111bcae30790af4611dd1f3e60c79fedc 100644 (file)
@@ -22,7 +22,7 @@ severity=minor
 
 
 
-status=open
+status=unconfirmed
 
 
 
index dcc2e84e84d5d3ae03b4d394dfb563c246286536..0b2bea5b4250d501fada80e7c002dfddeaa036b7 100644 (file)
@@ -36,6 +36,13 @@ summary=Implement adding comments.
 
 
 
+target=alpha
+
+
+
+
+
+
 time=Sat, 31 Jan 2009 03:00:08 +0000
 
 
diff --git a/cfbe.py b/cfbe.py
index 4509bf18e4bfa4279b3f6e830250f01c931bff75..ee779999f1393fdd558955563feb07ae24edce1a 100755 (executable)
--- a/cfbe.py
+++ b/cfbe.py
@@ -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)