Mercurial > treepkg
annotate reportstatus.py @ 16:7c55f3879c4d
Use the new status class and report start/stop time too
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Fri, 09 Mar 2007 19:39:13 +0100 |
parents | dfd89f81e66c |
children | 0cdda44240a6 |
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(): |
16
7c55f3879c4d
Use the new status class and report start/stop time too
Bernhard Herzog <bh@intevation.de>
parents:
14
diff
changeset
|
33 print line.name, revision.revision, revision.status.status |
7c55f3879c4d
Use the new status class and report start/stop time too
Bernhard Herzog <bh@intevation.de>
parents:
14
diff
changeset
|
34 print " start:", revision.status.start |
7c55f3879c4d
Use the new status class and report start/stop time too
Bernhard Herzog <bh@intevation.de>
parents:
14
diff
changeset
|
35 print " stop:", revision.status.stop |
14
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
36 |
dfd89f81e66c
Add simple status report tool. Still using the old status files
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
37 main() |