From: Stephen Soltesz Date: Thu, 25 Oct 2007 16:40:36 +0000 (+0000) Subject: Modified DocBook.py to use the same convention as NodeManager/doc/DocBook.py X-Git-Tag: PLCAPI-4.2-0~61 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=79514a4adcf7b4bd711ab384bc0c7cd11077a9b7;p=plcapi.git Modified DocBook.py to use the same convention as NodeManager/doc/DocBook.py Added DocBookLocal.py for the local creation of a function list for DocBook.py --- diff --git a/doc/DocBook.py b/doc/DocBook.py index 0185ab4d..0b279b25 100755 --- a/doc/DocBook.py +++ b/doc/DocBook.py @@ -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 index 00000000..4a029d2f --- /dev/null +++ b/doc/DocBookLocal.py @@ -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]