From c36d962d148d587899488d8bbca0d3fb0473f5dd Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 11 Dec 2009 14:07:34 +0100 Subject: make_doc.py to generate documentation --- make_doc.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 make_doc.py 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)) + -- cgit 1.4.1-2-gfad0