Starting packaging up.
authorSteve Losh <steve@stevelosh.com>
Mon, 2 Feb 2009 02:19:59 +0000 (21:19 -0500)
committerSteve Losh <steve@stevelosh.com>
Mon, 2 Feb 2009 02:19:59 +0000 (21:19 -0500)
.be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values
.be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values
.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values
.be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values
.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/values
cfbe.py
static/images/stripe.png [deleted file]
templates/base.html

index 93bc96853c1283d181cffe9b7106d4186f8e71d5..06269322bddc2b308f0d9a1335735b8596247288 100644 (file)
@@ -36,7 +36,7 @@ summary=Fix the null creation date bug.  See bug ee6 in the BE repo for an examp
 
 
 
-target=alpha
+target=beta
 
 
 
index 2f9356f94efc1adff3e04cfa2c6fb1ce511ffa54..134df9b3ffc59bdc1f229c23025d846f91e5e223 100644 (file)
@@ -22,7 +22,7 @@ severity=minor
 
 
 
-status=open
+status=closed
 
 
 
index d9d9aed56e25b8d9abc7376cc0687f434ae984a7..56ae9a10c1e4b4fd01f9a60aa0c4f28a4fffbc8a 100644 (file)
@@ -36,7 +36,7 @@ summary=Figure out how to best fix the column widths.
 
 
 
-target=alpha
+target=beta
 
 
 
index 2086515d8425cbf6dcacaaed7df346b26c7aeb23..e91a4cf26fb09179c12c869e586e7c2dd168b420 100644 (file)
@@ -22,7 +22,7 @@ severity=minor
 
 
 
-status=open
+status=closed
 
 
 
index d0cefdfa64e4cfb737d9f1f90a6265f266521b3a..964922fe77bf1fa087a37a97fdf385bbb198fb69 100644 (file)
@@ -29,7 +29,7 @@ status=open
 
 
 
-summary=Factor everything into a package.
+summary=Package everything into something easy to download and use.
 
 
 
diff --git a/cfbe.py b/cfbe.py
index 3de43e706d5dda2cb9307b7cedd248583727ba9a..f594f2b7749fb28adae02dba95b263973d25fe81 100755 (executable)
--- a/cfbe.py
+++ b/cfbe.py
@@ -4,11 +4,14 @@ import cherrypy
 from libbe import bugdir
 from jinja2 import Environment, FileSystemLoader
 from datetime import datetime
+from optparse import OptionParser
 
 
 def datetimeformat(value, format='%B %d, %Y at %I:%M %p'):
+    """Takes a timestamp and revormats it into a human-readable string."""
     return datetime.fromtimestamp(value).strftime(format)
 
+
 template_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/templates'
 env = Environment(loader=FileSystemLoader(template_root))
 env.filters['datetimeformat'] = datetimeformat
@@ -23,6 +26,7 @@ class WebInterface:
         self.repository_name = self.bd.root.split('/')[-1]
     
     def get_common_information(self):
+        """Returns a dict of common information that most pages will need."""
         possible_assignees = list(set([bug.assigned for bug in self.bd if unicode(bug.assigned) != 'None']))
         possible_assignees.sort(key=unicode.lower)
         
@@ -58,6 +62,10 @@ class WebInterface:
     
     @cherrypy.expose
     def index(self, status='open', assignee='', target=''):
+        """The main bug page.
+        Bugs can be filtered by assignee or target.
+        The bug database will be reloaded on each visit."""
+        
         self.bd.load_all_bugs()
         
         if status == 'open':
@@ -122,6 +130,7 @@ class WebInterface:
         
         raise cherrypy.HTTPRedirect('/bug?id=%s' % (shortname,), status=302)
     
+    
     @cherrypy.expose
     def edit(self, id, status=None, target=None, assignee=None, severity=None, summary=None):
         """The view that handles editing bug details."""
@@ -141,7 +150,26 @@ class WebInterface:
         raise cherrypy.HTTPRedirect('/bug?id=%s' % (shortname,), status=302)
     
 
+
+def build_parser():
+    """Builds and returns the command line option parser."""
+    
+    usage = 'usage: %prog bug_directory'
+    parser = OptionParser(usage)
+    return parser
+
+def parse_arguments():
+    """Parse the command line arguments."""
+    
+    parser = build_parser()
+    (options, args) = parser.parse_args()
+    
+    if len(args) != 1:
+        parser.error('You need to specify a bug directory.')
+    
+    return { 'bug_root': args[0], }
+
+
 config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config'
-# bug_root = '/Users/sjl/Desktop/be/.be'
-bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be'
-cherrypy.quickstart(WebInterface(bug_root), '/', config)
+options = parse_arguments()
+cherrypy.quickstart(WebInterface(options['bug_root']), '/', config)
diff --git a/static/images/stripe.png b/static/images/stripe.png
deleted file mode 100644 (file)
index a3c5e0a..0000000
Binary files a/static/images/stripe.png and /dev/null differ
index 0b44d81f7513ef608f2d802116c88084b7c9edd6..1f0ab7b5e998d51df86ee4bc8aa3478bd9374d63 100644 (file)
@@ -60,7 +60,6 @@
             <div id="content-pane" class="center-column">
                 <div id="nav">
                     <span id="filters">
-                        Just show me:
                         <a href="/">Open</a>
                         <a href="/?status=closed">Closed</a>
                         <a href="" id="filter-assignee">Assigned to...</a>