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@19: from treepkg.report import get_packager_group, prepare_report 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@19: bh@19: def report_text(group): bh@19: report = prepare_report(group) bh@19: for revno, row in report.revisions: bh@19: for col in row: bh@19: if col: bh@19: print "%s %s: %s" % (col.name, revno, col.status.desc) bh@19: if col.status.start: bh@19: print " Start:", col.status.start bh@19: print " Stop:", col.status.stop bh@19: print bh@19: bh@14: def main(): bh@14: options, args = parse_commandline() bh@19: group = get_packager_group(options.config_file) bh@19: report_text(group) bh@14: bh@14: bh@14: main()