diff reportstatus.py @ 14:dfd89f81e66c

Add simple status report tool. Still using the old status files
author Bernhard Herzog <bh@intevation.de>
date Fri, 09 Mar 2007 19:02:47 +0100
parents
children 7c55f3879c4d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/reportstatus.py	Fri Mar 09 19:02:47 2007 +0100
@@ -0,0 +1,35 @@
+#! /usr/bin/python2.4
+# Copyright (C) 2007 by Intevation GmbH
+# Authors:
+# Bernhard Herzog <bh@intevation.de>
+#
+# This program is free software under the GPL (>=v2)
+# Read the file COPYING coming with the software for details.
+
+"""Reports the current status of the tree packager"""
+
+import os
+from optparse import OptionParser
+
+from treepkg.packager import create_package_line, PackagerGroup
+from treepkg.readconfig import read_config
+
+def parse_commandline():
+    parser = OptionParser()
+    parser.set_defaults(config_file=os.path.join(os.path.dirname(__file__),
+                                                 "treepkg.cfg"))
+    parser.add_option("--config-file")
+    return parser.parse_args()
+
+def main():
+    options, args = parse_commandline()
+
+    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.get()
+
+main()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)