Modified DocBook.py to use the same convention as NodeManager/doc/DocBook.py
authorStephen Soltesz <soltesz@cs.princeton.edu>
Thu, 25 Oct 2007 16:40:36 +0000 (16:40 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Thu, 25 Oct 2007 16:40:36 +0000 (16:40 +0000)
Added DocBookLocal.py for the local creation of a function list for DocBook.py

doc/DocBook.py
doc/DocBookLocal.py [new file with mode: 0644]

index 0185ab4..0b279b2 100755 (executable)
@@ -13,10 +13,8 @@ import xml.dom.minidom
 from xml.dom.minidom import Element, Text
 import codecs
 
-from PLC.API import PLCAPI
 from PLC.Method import *
-
-api = PLCAPI(None)
+import DocBookLocal
 
 # xml.dom.minidom.Text.writexml adds surrounding whitespace to textual
 # data when pretty-printing. Override this behavior.
@@ -105,8 +103,9 @@ class paramElement(Element):
             for subparam in param:
                 itemizedlist.appendChild(paramElement(None, subparam))
 
-for method in api.methods:
-    func = api.callable(method)
+api_func_list = DocBookLocal.get_func_list()
+for func in api_func_list:
+    method = func.name
 
     if func.status == "deprecated":
         continue
diff --git a/doc/DocBookLocal.py b/doc/DocBookLocal.py
new file mode 100644 (file)
index 0000000..4a029d2
--- /dev/null
@@ -0,0 +1,7 @@
+
+from PLC.API import PLCAPI
+
+
+def get_func_list():
+       api = PLCAPI(None)
+       return [api.callable(method) for method in api.methods]