BIND 10 trac933preview, updated. 72bfe7299efc29290efc4768fb85bb8063ec3f55 [933preview] supported \note

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Jul 16 08:07:11 UTC 2012


The branch, trac933preview has been updated
       via  72bfe7299efc29290efc4768fb85bb8063ec3f55 (commit)
      from  f1a55f7156fc6a5b15d5a63802bbbc46f1582625 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 72bfe7299efc29290efc4768fb85bb8063ec3f55
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Jul 16 01:06:54 2012 -0700

    [933preview] supported \note

-----------------------------------------------------------------------

Summary of changes:
 src/lib/util/python/doxygen2pydoc.py.in |   52 ++++++++++++++++++++++++++++---
 1 file changed, 47 insertions(+), 5 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/util/python/doxygen2pydoc.py.in b/src/lib/util/python/doxygen2pydoc.py.in
index bd0772a..3ccf7c6 100755
--- a/src/lib/util/python/doxygen2pydoc.py.in
+++ b/src/lib/util/python/doxygen2pydoc.py.in
@@ -141,21 +141,46 @@ class Paragraph:
                 self.items.append(get_text(item))
         else:
             self.type = self.TEXT
-            self.text = get_text(xml_node)
+
+            # A single textual paragraph could have multiple simple sections
+            # if it contains notes.
+
+            self.texts = []
+            subnodes = []
+            for child in xml_node.childNodes:
+                if child.nodeType == child.ELEMENT_NODE and \
+                        child.nodeName == 'simplesect' and \
+                        child.getAttribute('kind') == 'note':
+                    if len(subnodes) > 0:
+                        self.texts.append(get_text_fromnodelist(subnodes))
+                        subnodes = []
+                    subtext = 'Note: '
+                    for t in child.childNodes:
+                        subtext += get_text(t)
+                    self.texts.append(subtext)
+                else:
+                    subnodes.append(child)
+            if len(subnodes) > 0:
+                self.texts.append(get_text_fromnodelist(subnodes))
 
     def dump(self, f, wrapper):
-        if (self.type == self.CPPLISTING):
+        if self.type == self.CPPLISTING:
             return
-        elif (self.type == self.ITEMIZEDLIST):
+        elif self.type == self.ITEMIZEDLIST:
             for item in self.items:
                 item_wrapper = TextWrapper(\
                     initial_indent=wrapper.initial_indent + "- ",
                     subsequent_indent=wrapper.subsequent_indent + "  ")
                 dump_filled_text(f, item_wrapper, item)
                 f.write("\\n\\\n")
+        elif self.type == self.TEXT:
+            for text in self.texts:
+                if text != self.texts[0]:
+                    f.write("\\n\\\n")
+                dump_filled_text(f, wrapper, text)
+                f.write("\\n\\\n")
         else:
-            dump_filled_text(f, wrapper if self.type == self.TEXT else None,
-                             self.text)
+            dump_filled_text(f, None, self.text)
             f.write("\\n\\\n")
         f.write("\\n\\\n")
 
@@ -329,6 +354,23 @@ def get_text(root, do_convert=True):
     # brief descriptions, which will cause lines not well aligned)
     return re.sub("^(\n*)", "", ''.join(rc))
 
+def get_text_fromnodelist(nodelist, do_convert=True):
+    """Recursively extract bare text inside the specified node (root),
+    concatenate all extracted text and return the result.
+    """
+    rc = []
+    for node in nodelist:
+        if node.nodeType == node.TEXT_NODE:
+            if do_convert:
+                rc.append(cpp_to_python(node.data))
+            else:
+                rc.append(node.data)
+        elif node.nodeType == node.ELEMENT_NODE:
+            rc.append(get_text(node))
+    # return the result, removing any leading newlines (that often happens for
+    # brief descriptions, which will cause lines not well aligned)
+    return re.sub("^(\n*)", "", ''.join(rc))
+
 def parse_parameters(nodelist):
     rc = []
     for node in nodelist:



More information about the bind10-changes mailing list