diff options
author | Steve Losh <steve@stevelosh.com> | 2009-02-07 12:39:19 -0500 |
---|---|---|
committer | Steve Losh <steve@stevelosh.com> | 2009-02-07 12:39:19 -0500 |
commit | 6132015512a0eec6852c8e2a3125f695e0840fb1 (patch) | |
tree | f258c2808d628f8db5542151f66ce6eb0d47f653 /cfbe.py | |
parent | 5f61c45a6f5265deb5a9da1fd53da66b4baae104 (diff) | |
download | bugseverywhere-6132015512a0eec6852c8e2a3125f695e0840fb1.tar.gz |
Refactored more into the web interface.
Diffstat (limited to 'cfbe.py')
-rwxr-xr-x | cfbe.py | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -2,21 +2,11 @@ import cherrypy from cherryflavoredbugseverywhere import web -from jinja2 import Environment, FileSystemLoader -from datetime import datetime from optparse import OptionParser from os import path module_dir = path.dirname(path.abspath(web.__file__)) - -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 = path.join(module_dir, 'templates') -env = Environment(loader=FileSystemLoader(template_root)) -env.filters['datetimeformat'] = datetimeformat +template_dir = path.join(module_dir, 'templates') def build_parser(): """Builds and returns the command line option parser.""" @@ -40,5 +30,5 @@ def parse_arguments(): config = path.join(module_dir, 'cfbe.config') options = parse_arguments() -WebInterface = web.WebInterface(path.abspath(options['bug_root'])) +WebInterface = web.WebInterface(path.abspath(options['bug_root']), template_dir) cherrypy.quickstart(WebInterface, '/', config) |