Commits

Maciej Fijalkowski committed fbb8c80 Draft

another missing file

Comments (0)

Files changed (1)

bin/import_roundup.py

+#!/usr/bin/env python
+""" Run with:
+
+import_roundup.py <roundup dir> <output dir>
+"""
+
+import sys, os
+from trakker.roundup import RoundupSQL
+from docutils.utils import SystemMessage
+
+def main(argv):
+    if len(argv) != 2:
+        print __doc__
+        return 1
+    r = RoundupSQL(argv[0])
+    res = r.get_comments()
+    out_dir = argv[1]
+    counter = 0
+    for elem in res.values():
+        path = os.path.join(out_dir, 'issue' + str(elem.num) + '.rst')
+        with open(path, "w") as f:
+            try:
+                elem.check_renders()
+            except SystemMessage:
+                counter += 1
+                print "issue%d did not render" % (elem.num,)
+            f.write(elem.render().encode('utf-8'))
+    if counter == 0:
+        print "All correctly rendered!"
+    else:
+        print "Not correctly rendering: %d" % counter
+    return 0
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv[1:]))