bh@287: #! /usr/bin/python bh@287: # Copyright (C) 2007, 2008, 2009 by Intevation GmbH thomas@78: # Authors: thomas@78: # Bernhard Herzog thomas@78: # thomas@78: # This program is free software under the GPL (>=v2) thomas@78: # Read the file COPYING coming with the software for details. thomas@78: thomas@78: """Starts the tree packager webinterface""" thomas@78: thomas@78: import sys thomas@78: import os thomas@78: from optparse import OptionParser thomas@78: thomas@78: import treepkgcmd thomas@78: from treepkg.options import create_parser thomas@78: from treepkg.web import runserver thomas@78: thomas@78: def parse_commandline(): thomas@78: parser = create_parser() thomas@78: parser.set_defaults(cherrypy_config=os.path.join(treepkgcmd.topdir, bh@152: "cherrypy.cfg"), bh@154: status_template="status-by-startdate.html") thomas@78: parser.add_option("--cherrypy-config", thomas@78: help=("The cherrypy config file for the web interface." thomas@78: " Default cherrypy.cfg")) bh@152: parser.add_option("--status-template", bh@152: help=("The template file to use for the status page." bh@152: " Relative filenames are interpreted" bh@152: " relative to the web subdirectory." bh@152: " Default is status-by-revision.html.")) thomas@78: return parser.parse_args() thomas@78: thomas@78: def main(): thomas@78: options, args = parse_commandline() bh@152: runserver(options.config_file, options.cherrypy_config, bh@152: status_template=options.status_template) thomas@78: thomas@78: main()