MCPcopy Create free account
hub / github.com/scanny/python-pptx / _non_empty_element_xml

Method _non_empty_element_xml

tests/unitdata.py:91–105  ·  view source on GitHub ↗
(self, indent)

Source from the content-addressed store, hash-verified

89 return len(self._child_bldrs) == 0 and len(self._text) == 0
90
91 def _non_empty_element_xml(self, indent):
92 indent_str = " " * indent
93 if self._text:
94 xml = "%s%s%s%s" % ( # pragma: no cover
95 indent_str,
96 self._start_tag,
97 self._text,
98 self._end_tag,
99 )
100 else:
101 xml = "%s%s\n" % (indent_str, self._start_tag)
102 for child_bldr in self._child_bldrs:
103 xml += child_bldr.xml(indent + 2)
104 xml += "%s%s" % (indent_str, self._end_tag)
105 return xml
106
107 def _set_xmlattr(self, xmlattr_name, value):
108 xmlattr_str = ' %s="%s"' % (xmlattr_name, str(value))

Callers 1

xmlMethod · 0.95

Calls 1

xmlMethod · 0.45

Tested by

no test coverage detected