summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-11 14:07:34 +0100
committerhut <hut@lavabit.com>2009-12-11 14:07:34 +0100
commitc36d962d148d587899488d8bbca0d3fb0473f5dd (patch)
tree1ea1e17b5a917e35321b8e9d0ad366f53eef33b0
parentf58626842bbb2bd3f8446044a44a67180b737f4e (diff)
downloadranger-c36d962d148d587899488d8bbca0d3fb0473f5dd.tar.gz
make_doc.py to generate documentation
-rwxr-xr-xmake_doc.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/make_doc.py b/make_doc.py
new file mode 100755
index 00000000..57285790
--- /dev/null
+++ b/make_doc.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python3
+"""Generate pydoc documentation and move it to the doc directory.
+THIS WILL DELETE ALL EXISTING HTML FILES IN THAT DIRECTORY, so don't
+store important content there."""
+
+import pydoc, os, sys
+if __name__ == '__main__':
+	docdir = 'doc'
+	os.chdir(sys.path[0])
+	try: os.mkdir(docdir)
+	except: pass
+
+
+	for fname in os.listdir(docdir):
+		if fname.endswith('.html'):
+			os.remove(os.path.join(docdir, fname))
+
+	pydoc.writedocs('.')
+
+	for fname in os.listdir('.'):
+		if fname.endswith('.html'):
+			os.rename(fname, os.path.join(docdir, fname))
+
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168