view 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
line wrap: on
line source
#! /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.status
            print "    start:", revision.status.start
            print "     stop:", revision.status.stop

main()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)