1. Steve Losh
  2. cherryflavoredbugseverywhere

Commits

Steve Losh  committed b1e6b41

Starting packaging up.

  • Participants
  • Parent commits 77111ab
  • Branches default

Comments (0)

Files changed (8)

File .be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values

View file
 
 
 
-target=alpha
+target=beta
 
 
 

File .be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values

View file
 
 
 
-status=open
+status=closed
 
 
 

File .be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values

View file
 
 
 
-target=alpha
+target=beta
 
 
 

File .be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values

View file
 
 
 
-status=open
+status=closed
 
 
 

File .be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/values

View file
 
 
 
-summary=Factor everything into a package.
+summary=Package everything into something easy to download and use.
 
 
 

File cfbe.py

View file
 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
         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)
         
     
     @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':
         
         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."""
         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)

File static/images/stripe.png

Removed
Old image

File templates/base.html

View file
             <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>