4 from cherryflavoredbugseverywhere import web
5 from optparse import OptionParser
8 module_dir = path.dirname(path.abspath(web.__file__))
9 template_dir = path.join(module_dir, 'templates')
12 """Builds and returns the command line option parser."""
14 usage = 'usage: %prog bug_directory'
15 parser = OptionParser(usage)
18 def parse_arguments():
19 """Parse the command line arguments."""
21 parser = build_parser()
22 (options, args) = parser.parse_args()
25 parser.error('You need to specify a bug directory.')
27 return { 'bug_root': args[0], }
30 config = path.join(module_dir, 'cfbe.config')
31 options = parse_arguments()
33 WebInterface = web.WebInterface(path.abspath(options['bug_root']), template_dir)
35 cherrypy.config.update({'tools.staticdir.root': path.join(module_dir, 'static')})
36 app_config = { '/static': { 'tools.staticdir.on': True,
37 'tools.staticdir.dir': '', } }
38 cherrypy.quickstart(WebInterface, '/', app_config)