s4-waf: added pydoctor and wafdocs targets
authorAndrew Tridgell <tridge@samba.org>
Mon, 29 Mar 2010 06:12:04 +0000 (17:12 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:15 +0000 (20:27 +1000)
these generate html documentation for the Samba python code

You need a very recent version of pydoctor

source4/wscript

index e662d0db92cddbf8a35cf6fa04471e883d245279..09ce8a3ccc1bad62126998a345bb7c8ac965fa8c 100644 (file)
@@ -93,3 +93,23 @@ def ctags(ctx):
 def build(bld):
     '''build all targets'''
     pass
+
+
+def pydoctor(ctx):
+    '''build python apidocs'''
+    cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package bin/python/samba'
+    print "Running: %s" % cmd
+    os.system(cmd)
+
+def wafdocs(ctx):
+    '''build wafsamba apidocs'''
+    from samba_utils import recursive_dirlist
+    os.system('pwd')
+    list = recursive_dirlist('../buildtools/wafsamba', '.', pattern='*.py')
+
+    cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
+    print list
+    for f in list:
+        cmd += ' --add-module %s' % f
+    print "Running: %s" % cmd
+    os.system(cmd)