diff bin/treepkginfo.py @ 399:04310ad0063e treepkg-status

let the user specify num revisions that should be shown in the info
author Bjoern Ricks <bricks@intevation.de>
date Mon, 12 Jul 2010 12:10:34 +0000
parents e2afbd3c2bf1
children 94a6ae627b31
line wrap: on
line diff
--- a/bin/treepkginfo.py	Fri Jul 09 15:06:15 2010 +0000
+++ b/bin/treepkginfo.py	Mon Jul 12 12:10:34 2010 +0000
@@ -16,12 +16,23 @@
 
 def parse_commandline():
     parser = create_parser()
+    parser.set_defaults(newest=-1)
+    parser.add_option("--newest", type="int",
+                      help=("Number of newest revisions to list."))
+    parser.add_option("--pretty", action="store_true", help=("Show XML pretty"
+                      " output."))
  
+
     return parser.parse_args()
 
 def main():
     options, args = parse_commandline()
 
-    tpkginfo = status.TreepkgInfo(options.config_file)
+    tpkginfo = status.TreepkgInfo(options.config_file, options.newest)
+
+    if options.pretty:
+        print tpkginfo.toxml().toprettyxml()
+    else:
+        print tpkginfo.toxml().toxml()
 
 main()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)