]> scripts.mit.edu Git - wizard.git/commitdiff
Simple Trac stub collection information.
authorEdward Z. Yang <ezyang@mit.edu>
Mon, 26 Sep 2011 03:02:32 +0000 (23:02 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Mon, 26 Sep 2011 03:02:32 +0000 (23:02 -0400)
wizard/command/summary/trac.py [new file with mode: 0644]

diff --git a/wizard/command/summary/trac.py b/wizard/command/summary/trac.py
new file mode 100644 (file)
index 0000000..2699cd4
--- /dev/null
@@ -0,0 +1,29 @@
+import math
+import distutils.version
+
+from wizard import app, command, deploy, util
+
+def main(argv, baton):
+    options, str_show = parse_args(argv, baton)
+    variants = set()
+    counter = util.Counter()
+    for d in deploy.parse_install_lines('trac', options.versions_path):
+        counter.count(d.read('trac.fcgi'))
+    for k in counter:
+        print "%08x: %d" % (hash(k), counter[k])
+    print "----"
+    for k in counter:
+        print "%08x:\n%s" % k
+        print "----"
+
+def parse_args(argv, baton):
+    usage = """usage: %prog summary trac [ARGS]
+
+Figures out what version the Trac stubs are."""
+    parser = command.WizardOptionParser(usage)
+    baton.push(parser, "versions_path")
+    options, args = parser.parse_all(argv)
+    if len(args) > 1:
+        parser.error("too many arguments")
+    return options, args
+