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: """Creates a static web-site with a status report""" thomas@78: thomas@78: import sys thomas@78: import os thomas@78: thomas@78: import treepkgcmd thomas@78: from treepkg.options import create_parser thomas@78: from treepkg.web import Status thomas@78: thomas@78: def parse_commandline(): bh@152: parser = create_parser() bh@154: parser.set_defaults(status_template="status-by-startdate.html") aheinecke@372: parser.set_defaults(show_logs="build_log.txt.gz") 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@325: " Default is status-by-startdate.html.")) aheinecke@372: parser.add_option("--show-logs", aheinecke@372: help=("A comma seperated list of filenames of the" aheinecke@372: " logs that should be included in the status page." aheinecke@372: " Valid names are filenames of the files" aheinecke@372: " in the log dir of a package. e.g." aheinecke@372: " --show-logs=tarball_log.txt,dpkg_source.txt" aheinecke@372: " Default is build_log.txt.gz")) bh@152: return parser.parse_args() thomas@78: aheinecke@372: def create_static_site(treepkg_config, status_template, show_logs, destdir): aheinecke@372: status = Status(treepkg_config=treepkg_config, template=status_template, aheinecke@372: logs=show_logs.split(",")) thomas@78: status.create_static_site(destdir) thomas@78: thomas@78: def main(): thomas@78: options, args = parse_commandline() bh@152: create_static_site(options.config_file, bh@152: options.status_template, aheinecke@372: options.show_logs, bh@152: args[0]) thomas@78: thomas@78: main()