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") 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.")) bh@152: return parser.parse_args() thomas@78: bh@152: def create_static_site(treepkg_config, status_template, destdir): bh@152: status = Status(treepkg_config=treepkg_config, template=status_template) 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, bh@152: args[0]) thomas@78: thomas@78: main()