Mercurial > treepkg
comparison bin/starttreepkgweb.py @ 152:4adcb15cbdfb
Let the user supply the filename of the template to use for the status page.
bin/createstaticweb.py and bin/starttreepkgweb.py now have an additional
option --status-template for the filename of the template, and the code
in treepkg/web.py accepts the filename as parameter in various places.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Mon, 09 Jun 2008 16:33:20 +0000 |
parents | 9a602d8eaa60 |
children | a30351c91a68 |
comparison
equal
deleted
inserted
replaced
151:77d7f2cbd7ce | 152:4adcb15cbdfb |
---|---|
1 #! /usr/bin/python2.4 | 1 #! /usr/bin/python2.4 |
2 # Copyright (C) 2007 by Intevation GmbH | 2 # Copyright (C) 2007, 2008 by Intevation GmbH |
3 # Authors: | 3 # Authors: |
4 # Bernhard Herzog <bh@intevation.de> | 4 # Bernhard Herzog <bh@intevation.de> |
5 # | 5 # |
6 # This program is free software under the GPL (>=v2) | 6 # This program is free software under the GPL (>=v2) |
7 # Read the file COPYING coming with the software for details. | 7 # Read the file COPYING coming with the software for details. |
17 from treepkg.web import runserver | 17 from treepkg.web import runserver |
18 | 18 |
19 def parse_commandline(): | 19 def parse_commandline(): |
20 parser = create_parser() | 20 parser = create_parser() |
21 parser.set_defaults(cherrypy_config=os.path.join(treepkgcmd.topdir, | 21 parser.set_defaults(cherrypy_config=os.path.join(treepkgcmd.topdir, |
22 "cherrypy.cfg")) | 22 "cherrypy.cfg"), |
23 status_template="status-by-revision.html") | |
23 parser.add_option("--cherrypy-config", | 24 parser.add_option("--cherrypy-config", |
24 help=("The cherrypy config file for the web interface." | 25 help=("The cherrypy config file for the web interface." |
25 " Default cherrypy.cfg")) | 26 " Default cherrypy.cfg")) |
27 parser.add_option("--status-template", | |
28 help=("The template file to use for the status page." | |
29 " Relative filenames are interpreted" | |
30 " relative to the web subdirectory." | |
31 " Default is status-by-revision.html.")) | |
26 return parser.parse_args() | 32 return parser.parse_args() |
27 | 33 |
28 def main(): | 34 def main(): |
29 options, args = parse_commandline() | 35 options, args = parse_commandline() |
30 runserver(options.config_file, options.cherrypy_config) | 36 runserver(options.config_file, options.cherrypy_config, |
37 status_template=options.status_template) | |
31 | 38 |
32 main() | 39 main() |