From ad16479b21e9482cdc8bb68e3a50f7f62cd5642d Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Wed, 25 Oct 2006 19:35:36 +0000 Subject: [PATCH] - add Returns: section for each method --- doc/DocBook.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/DocBook.py b/doc/DocBook.py index 8634a8f..84a5121 100755 --- a/doc/DocBook.py +++ b/doc/DocBook.py @@ -6,7 +6,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: DocBook.py,v 1.1 2006/09/06 15:34:41 mlhuang Exp $ +# $Id: DocBook.py,v 1.2 2006/10/25 14:32:01 mlhuang Exp $ # import xml.dom.minidom @@ -215,4 +215,21 @@ for method in api.methods: else: blockquote.appendChild(paraElement("None")) + para = paraElement('Returns:') + blockquote = blockquoteElement() + para.appendChild(blockquote) + section.appendChild(para) + + head = rowElement(['Name', 'Type', 'Optional', 'Description']) + if isinstance(func.returns, Parameter): + doc = func.returns.doc + else: + doc = "" + indent = " " + rows = parameters(func.returns, "", None, doc, "", indent) + informaltable = informaltableElement(head, rows) + informaltable.setAttribute('frame', "none") + informaltable.setAttribute('rules', "rows") + blockquote.appendChild(informaltable) + print section.toprettyxml(encoding = "UTF-8") -- 2.43.0