chiark / gitweb /
update.py: Allow to output pretty (human-readable) index.xml .
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>
Wed, 15 Feb 2012 00:18:32 +0000 (02:18 +0200)
committerCiaran Gultnieks <ciaran@ciarang.com>
Wed, 15 Feb 2012 07:10:29 +0000 (07:10 +0000)
update.py

index 367d754435d6e3647c1deaeff458d0b89dee0144..a77faa2cf1eea642a542a419dc3ddee189eaef9e 100755 (executable)
--- a/update.py
+++ b/update.py
@@ -53,6 +53,8 @@ parser.add_option("-i", "--interactive", default=False, action="store_true",
 parser.add_option("-e", "--editor", default="/etc/alternatives/editor",
                   help="Specify editor to use in interactive mode. Default "+
                       "is /etc/alternatives/editor")
+parser.add_option("", "--pretty", action="store_true", default=False,
+                  help="Produce human-readable index.xml")
 (options, args) = parser.parse_args()
 
 
@@ -439,7 +441,10 @@ for app in apps:
         apps_disabled += 1
 
 of = open(os.path.join('repo','index.xml'), 'wb')
-output = doc.toxml()
+if options.pretty:
+    output = doc.toprettyxml()
+else:
+    output = doc.toxml()
 of.write(output)
 of.close()