Mercurial > treepkg
comparison bin/createstaticweb.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. |
14 import treepkgcmd | 14 import treepkgcmd |
15 from treepkg.options import create_parser | 15 from treepkg.options import create_parser |
16 from treepkg.web import Status | 16 from treepkg.web import Status |
17 | 17 |
18 def parse_commandline(): | 18 def parse_commandline(): |
19 return create_parser().parse_args() | 19 parser = create_parser() |
20 parser.set_defaults(status_template="status-by-revision.html") | |
21 parser.add_option("--status-template", | |
22 help=("The template file to use for the status page." | |
23 " Relative filenames are interpreted" | |
24 " relative to the web subdirectory." | |
25 " Default is status-by-revision.html.")) | |
26 return parser.parse_args() | |
20 | 27 |
21 def create_static_site(treepkg_config, destdir): | 28 def create_static_site(treepkg_config, status_template, destdir): |
22 status = Status(treepkg_config=treepkg_config) | 29 status = Status(treepkg_config=treepkg_config, template=status_template) |
23 status.create_static_site(destdir) | 30 status.create_static_site(destdir) |
24 | 31 |
25 def main(): | 32 def main(): |
26 options, args = parse_commandline() | 33 options, args = parse_commandline() |
27 create_static_site(options.config_file, args[0]) | 34 create_static_site(options.config_file, |
35 options.status_template, | |
36 args[0]) | |
28 | 37 |
29 main() | 38 main() |