diff options
author | Steve Losh <steve@stevelosh.com> | 2009-02-01 21:19:59 -0500 |
---|---|---|
committer | Steve Losh <steve@stevelosh.com> | 2009-02-01 21:19:59 -0500 |
commit | d29f2c497b61e39408cbad015a2f27307021cb75 (patch) | |
tree | 6b6af9d2fb35784621a612d9406ddb442defb9e3 | |
parent | 33d22e0bf80c3268578676dc8895a133df5a878b (diff) | |
download | bugseverywhere-d29f2c497b61e39408cbad015a2f27307021cb75.tar.gz |
Starting packaging up.
-rw-r--r-- | .be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values | 2 | ||||
-rw-r--r-- | .be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values | 2 | ||||
-rw-r--r-- | .be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values | 2 | ||||
-rw-r--r-- | .be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values | 2 | ||||
-rw-r--r-- | .be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/values | 2 | ||||
-rwxr-xr-x | cfbe.py | 34 | ||||
-rw-r--r-- | static/images/stripe.png | bin | 101 -> 0 bytes | |||
-rw-r--r-- | templates/base.html | 1 |
8 files changed, 36 insertions, 9 deletions
diff --git a/.be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values b/.be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values index 93bc968..0626932 100644 --- a/.be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values +++ b/.be/bugs/0be47243-c172-4de9-b71b-d5dea60f91d5/values @@ -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 diff --git a/.be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values b/.be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values index 2f9356f..134df9b 100644 --- a/.be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values +++ b/.be/bugs/35b962a0-a64a-4b5c-82c5-ea740e8a6322/values @@ -22,7 +22,7 @@ severity=minor -status=open +status=closed diff --git a/.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values b/.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values index d9d9aed..56ae9a1 100644 --- a/.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values +++ b/.be/bugs/615ad650-9fb9-4026-9779-58d42b4e528e/values @@ -36,7 +36,7 @@ summary=Figure out how to best fix the column widths. -target=alpha +target=beta diff --git a/.be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values b/.be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values index 2086515..e91a4cf 100644 --- a/.be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values +++ b/.be/bugs/870d5dbe-6449-4ec4-ae6f-e84bebadbce0/values @@ -22,7 +22,7 @@ severity=minor -status=open +status=closed diff --git a/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/values b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/values index d0cefdf..964922f 100644 --- a/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/values +++ b/.be/bugs/e645d562-6f84-4df2-b8ee-86ef42546c16/values @@ -29,7 +29,7 @@ status=open -summary=Factor everything into a package. +summary=Package everything into something easy to download and use. @@ -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 Binary files differdeleted file mode 100644 index a3c5e0a..0000000 --- a/static/images/stripe.png +++ /dev/null diff --git a/templates/base.html b/templates/base.html index 0b44d81..1f0ab7b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -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> |