bricks@392: #! /usr/bin/python bricks@392: # Copyright (C) 2010 by Intevation GmbH bricks@392: # Authors: bricks@392: # Bjoern Ricks bricks@392: # bricks@392: # This program is free software under the GPL (>=v2) bricks@392: # Read the file COPYING coming with the software for details. bricks@392: bricks@392: """Receive the status of a treepkg""" bricks@392: bricks@392: import treepkgcmd bricks@392: bricks@392: from treepkg.info import status bricks@392: bricks@392: from treepkg.options import create_parser bricks@392: bricks@392: def parse_commandline(): bricks@392: parser = create_parser() bricks@399: parser.set_defaults(newest=-1) bricks@399: parser.add_option("--newest", type="int", bricks@399: help=("Number of newest revisions to list.")) bricks@399: parser.add_option("--pretty", action="store_true", help=("Show XML pretty" bricks@399: " output.")) bricks@392: bricks@399: bricks@392: return parser.parse_args() bricks@392: bricks@392: def main(): bricks@392: options, args = parse_commandline() bricks@392: bricks@399: tpkginfo = status.TreepkgInfo(options.config_file, options.newest) bricks@399: bricks@399: if options.pretty: bricks@399: print tpkginfo.toxml().toprettyxml() bricks@399: else: bricks@399: print tpkginfo.toxml().toxml() bricks@392: bricks@392: main()