Mercurial > treepkg
diff reportstatus.py @ 19:0cdda44240a6
Add treepkg/report.py for reporting and use it in reportstatus.py
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Tue, 13 Mar 2007 19:21:37 +0100 |
parents | 7c55f3879c4d |
children |
line wrap: on
line diff
--- a/reportstatus.py Tue Mar 13 16:51:46 2007 +0100 +++ b/reportstatus.py Tue Mar 13 19:21:37 2007 +0100 @@ -11,8 +11,7 @@ import os from optparse import OptionParser -from treepkg.packager import create_package_line, PackagerGroup -from treepkg.readconfig import read_config +from treepkg.report import get_packager_group, prepare_report def parse_commandline(): parser = OptionParser() @@ -21,17 +20,22 @@ parser.add_option("--config-file") return parser.parse_args() + +def report_text(group): + report = prepare_report(group) + for revno, row in report.revisions: + for col in row: + if col: + print "%s %s: %s" % (col.name, revno, col.status.desc) + if col.status.start: + print " Start:", col.status.start + print " Stop:", col.status.stop + print + def main(): options, args = parse_commandline() + group = get_packager_group(options.config_file) + report_text(group) - treepkg_opts, packager_opts = read_config(options.config_file) - group = PackagerGroup([create_package_line(**opts) - for opts in packager_opts], - **treepkg_opts) - for line in group.get_package_lines(): - for revision in line.get_revisions(): - print line.name, revision.revision, revision.status.status - print " start:", revision.status.start - print " stop:", revision.status.stop main()