MCPcopy Create free account
hub / github.com/SimpleITK/SimpleITK / parse_Text

Method parse_Text

Utilities/GenerateDocs/doxy2swig.py:132–153  ·  view source on GitHub ↗
(self, node)

Source from the content-addressed store, hash-verified

130 self.parse(node.documentElement)
131
132 def parse_Text(self, node):
133 txt = node.data
134
135 txt = txt.replace("\\", r"\\\\")
136 txt = txt.replace('"', r"\"")
137
138 if self.java:
139 txt = txt.replace("&", "&")
140 txt = txt.replace("<", "&lt;")
141 txt = txt.replace(">", "&gt;")
142
143 # ignore pure whitespace
144 m = self.space_re.match(txt)
145 if m and len(m.group()) == len(txt):
146 pass
147 else:
148 # if we're in a "See" node and starting a new line, indent one space
149 if self.insideSee and len(self.pieces) and self.pieces[-1][-1] == "\n":
150 self.add_text(" ")
151 if node.parentNode.nodeName != "definition":
152 txt = textwrap.fill(txt)
153 self.add_text(txt)
154
155 def parse_Element(self, node):
156 """Parse an `ELEMENT_NODE`. This calls specific

Callers

nothing calls this directly

Calls 1

add_textMethod · 0.95

Tested by

no test coverage detected