summaryrefslogtreecommitdiff
path: root/grc/src/grc_gnuradio/utils/extract_docs.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/src/grc_gnuradio/utils/extract_docs.py')
-rw-r--r--grc/src/grc_gnuradio/utils/extract_docs.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/grc/src/grc_gnuradio/utils/extract_docs.py b/grc/src/grc_gnuradio/utils/extract_docs.py
index 13fe77a56c..c9c872ef5a 100644
--- a/grc/src/grc_gnuradio/utils/extract_docs.py
+++ b/grc/src/grc_gnuradio/utils/extract_docs.py
@@ -29,15 +29,18 @@ DOXYGEN_DETAILDESC_GR_XPATH = '/doxygen/compounddef/detaileddescription'
DOXYGEN_BRIEFDESC_BLKS2_XPATH = '/doxygen/compounddef/sectiondef[@kind="public-func"]/memberdef/briefdescription'
DOXYGEN_DETAILDESC_BLKS2_XPATH = '/doxygen/compounddef/sectiondef[@kind="public-func"]/memberdef/detaileddescription'
-def extract_txt(xml):
+def extract_txt(xml, parent_text=None):
"""!
Recursivly pull the text out of an xml tree.
@param xml the xml tree
+ @param parent_text the text of the parent element
@return a string
"""
text = xml.text or ''
- if not len(xml): return text
- return ''.join([text] + map(extract_txt, xml))
+ tail = parent_text and xml.tail or ''
+ return text + ''.join(
+ map(lambda x: extract_txt(x, text), xml)
+ ) + tail
def is_match(key, file):
"""!