bh@14: #! /usr/bin/python2.4 bh@14: # Copyright (C) 2007 by Intevation GmbH bh@14: # Authors: bh@14: # Bernhard Herzog bh@14: # bh@14: # This program is free software under the GPL (>=v2) bh@14: # Read the file COPYING coming with the software for details. bh@14: bh@14: """Reports the current status of the tree packager""" bh@14: bh@14: import os bh@14: from optparse import OptionParser bh@14: bh@14: from treepkg.packager import create_package_line, PackagerGroup bh@14: from treepkg.readconfig import read_config bh@14: bh@14: def parse_commandline(): bh@14: parser = OptionParser() bh@14: parser.set_defaults(config_file=os.path.join(os.path.dirname(__file__), bh@14: "treepkg.cfg")) bh@14: parser.add_option("--config-file") bh@14: return parser.parse_args() bh@14: bh@14: def main(): bh@14: options, args = parse_commandline() bh@14: bh@14: treepkg_opts, packager_opts = read_config(options.config_file) bh@14: group = PackagerGroup([create_package_line(**opts) bh@14: for opts in packager_opts], bh@14: **treepkg_opts) bh@14: for line in group.get_package_lines(): bh@14: for revision in line.get_revisions(): bh@16: print line.name, revision.revision, revision.status.status bh@16: print " start:", revision.status.start bh@16: print " stop:", revision.status.stop bh@14: bh@14: main()