def cull_doc(elem): global adjusted_node doc = elem.get("doc") if doc: doc_lines = parseDocSummary(doc.split('
')) elem.set("doc", "\n".join(doc_lines)) # ElementTree's been patched. for child in elem: cull_doc(child)
def setCixDoc(cixelement, doctext, parse=False): if parse: doclines = parseDocSummary(doctext.splitlines(0)) doctext = "\n".join(doclines) elif sys.platform.startswith("win"): doctext = doctext.replace("\r\n", "\n") # TODO: By default clip doc content down to a smaller set -- just # enough for a good calltip. By then also want an option to # *not* clip, for use in documentation generation. # if len(doctext) > 1000: # warnings.warn("doctext for cixelement: %r has length: %d" % ( # cixelement.get("name"), len(doctext))) cixelement.attrib["doc"] = strip_invalid_xml_chars(doctext)
def setCixDoc(cixelement, doctext, parse=False): if parse: doclines = parseDocSummary(doctext.splitlines(0)) doctext = "\n".join(doclines) elif sys.platform.startswith("win"): doctext = doctext.replace("\r\n", "\n") #TODO: By default clip doc content down to a smaller set -- just # enough for a good calltip. By then also want an option to # *not* clip, for use in documentation generation. #if len(doctext) > 1000: # warnings.warn("doctext for cixelement: %r has length: %d" % ( # cixelement.get("name"), len(doctext))) cixelement.attrib["doc"] = strip_invalid_xml_chars(doctext)
def _docstring_from_node(node): s = _preferred_docstring_from_node(node) lines = util.parseDocSummary(s.splitlines(0)) return '\n'.join(lines)
def get_docstring_cix(parse_tree_node, cix_node): if len(parse_tree_node.doc_lines) >= 1: summarylines = util.parseDocSummary(parse_tree_node.doc_lines) if len(summarylines) > 0: cix_node.set("doc", "\n".join(summarylines))