Mercurial > treepkg
annotate reportstatus.py @ 15:667ae96b50f7
Add a stop field to the status
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Fri, 09 Mar 2007 19:38:46 +0100 |
parents | dfd89f81e66c |
children | 7c55f3879c4d |
rev | line source |
---|---|
14
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
1 #! /usr/bin/python2.4 |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
2 # Copyright (C) 2007 by Intevation GmbH |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
3 # Authors: |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
4 # Bernhard Herzog <bh@intevation.de> |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
5 # |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
6 # This program is free software under the GPL (>=v2) |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
7 # Read the file COPYING coming with the software for details. |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
8 |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
9 """Reports the current status of the tree packager""" |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
10 |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
11 import os |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
12 from optparse import OptionParser |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
13 |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
14 from treepkg.packager import create_package_line, PackagerGroup |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
15 from treepkg.readconfig import read_config |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
16 |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
17 def parse_commandline(): |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
18 parser = OptionParser() |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
19 parser.set_defaults(config_file=os.path.join(os.path.dirname(__file__), |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
20 "treepkg.cfg")) |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
21 parser.add_option("--config-file") |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
22 return parser.parse_args() |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
23 |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
24 def main(): |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
25 options, args = parse_commandline() |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
26 |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
27 treepkg_opts, packager_opts = read_config(options.config_file) |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
28 group = PackagerGroup([create_package_line(**opts) |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
29 for opts in packager_opts], |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
30 **treepkg_opts) |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
31 for line in group.get_package_lines(): |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
32 for revision in line.get_revisions(): |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
33 print line.name, revision.revision, revision.status.get() |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
34 |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
35 main() |