From 163db326077d403f590520ec6b231a6981b2f4f2 Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Mon, 6 Jul 2015 03:30:54 +0300 Subject: [PATCH] Throwaway Ditz issue dump tool --- util/ditz_hack.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 util/ditz_hack.py diff --git a/util/ditz_hack.py b/util/ditz_hack.py new file mode 100644 index 00000000..bc888832 --- /dev/null +++ b/util/ditz_hack.py @@ -0,0 +1,30 @@ +#!/usr/bin/python +# +# Throwaway utility to dump Ditz issues for grooming. +# + +import os +import sys +import yaml + +def main(): + def issueConstructor(loader, node): + return node + + yaml.add_constructor('!ditz.rubyforge.org,2008-03-06/issue', issueConstructor) + + for fn in os.listdir(sys.argv[1]): + if fn[0:6] != 'issue-': + continue + with open(os.path.join(sys.argv[1], fn), 'rb') as f: + doc = yaml.load(f) + tmp = {} + for k,v in doc.value: + tmp[k.value] = v.value + if tmp.get('status', '') != ':closed': + print('*** ' + fn) + print(tmp.get('title', u'NOTITLE').encode('utf-8') + '\n') + print(tmp.get('desc', u'').encode('utf-8') + '\n') + +if __name__ == '__main__': + main()