comparison bin/createstaticweb.py @ 372:ef87d30468b6

Added the option to expose additional log files from the log directory. To enable this one can either set a build_logs value in the staticweb.cfg or call createstaticweb with the parameter --show-logs. Default behavior is to only publish the build log, although the title is now capitalized.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 21 Jun 2010 08:23:30 +0000
parents 85b5667f543e
children
comparison
equal deleted inserted replaced
371:d0304bc2d378 372:ef87d30468b6
16 from treepkg.web import Status 16 from treepkg.web import Status
17 17
18 def parse_commandline(): 18 def parse_commandline():
19 parser = create_parser() 19 parser = create_parser()
20 parser.set_defaults(status_template="status-by-startdate.html") 20 parser.set_defaults(status_template="status-by-startdate.html")
21 parser.set_defaults(show_logs="build_log.txt.gz")
21 parser.add_option("--status-template", 22 parser.add_option("--status-template",
22 help=("The template file to use for the status page." 23 help=("The template file to use for the status page."
23 " Relative filenames are interpreted" 24 " Relative filenames are interpreted"
24 " relative to the web subdirectory." 25 " relative to the web subdirectory."
25 " Default is status-by-startdate.html.")) 26 " Default is status-by-startdate.html."))
27 parser.add_option("--show-logs",
28 help=("A comma seperated list of filenames of the"
29 " logs that should be included in the status page."
30 " Valid names are filenames of the files"
31 " in the log dir of a package. e.g."
32 " --show-logs=tarball_log.txt,dpkg_source.txt"
33 " Default is build_log.txt.gz"))
26 return parser.parse_args() 34 return parser.parse_args()
27 35
28 def create_static_site(treepkg_config, status_template, destdir): 36 def create_static_site(treepkg_config, status_template, show_logs, destdir):
29 status = Status(treepkg_config=treepkg_config, template=status_template) 37 status = Status(treepkg_config=treepkg_config, template=status_template,
38 logs=show_logs.split(","))
30 status.create_static_site(destdir) 39 status.create_static_site(destdir)
31 40
32 def main(): 41 def main():
33 options, args = parse_commandline() 42 options, args = parse_commandline()
34 create_static_site(options.config_file, 43 create_static_site(options.config_file,
35 options.status_template, 44 options.status_template,
45 options.show_logs,
36 args[0]) 46 args[0])
37 47
38 main() 48 main()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)