]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
add doc gen helper
authorBob Halley <halley@dnspython.org>
Sat, 14 Jan 2017 16:21:06 +0000 (08:21 -0800)
committerBob Halley <halley@dnspython.org>
Sat, 14 Jan 2017 16:21:06 +0000 (08:21 -0800)
doc/util/auto-values.py [new file with mode: 0644]

diff --git a/doc/util/auto-values.py b/doc/util/auto-values.py
new file mode 100644 (file)
index 0000000..cd73818
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+import importlib
+import sys
+
+name = sys.argv[1]
+title = sys.argv[2]
+
+print(title)
+print('=' * len(title))
+print()
+
+module = importlib.import_module(name)
+for t in sorted(module._by_text.keys()):
+    print('.. py:data:: {}.{}'.format(name, t))
+    print('   :annotation: = {}'.format(module._by_text[t]))