MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / xml_indent

Function xml_indent

tools/utils.py:93–106  ·  view source on GitHub ↗
(elem, level=0)

Source from the content-addressed store, hash-verified

91 return os.path.join(*segments)
92
93def xml_indent(elem, level=0):
94 i = "\n" + level*" "
95 if len(elem):
96 if not elem.text or not elem.text.strip():
97 elem.text = i + " "
98 if not elem.tail or not elem.tail.strip():
99 elem.tail = i
100 for elem in elem:
101 xml_indent(elem, level+1)
102 if not elem.tail or not elem.tail.strip():
103 elem.tail = i
104 else:
105 if level and (not elem.tail or not elem.tail.strip()):
106 elem.tail = i
107
108
109source_ext = ["c", "h", "s", "S", "cpp", "cxx", "cc", "xpm"]

Callers 11

CLGenWorkspaceFunction · 0.90
TargetCodeliteFunction · 0.90
_CDKProjectFunction · 0.90
VSProjectFunction · 0.90
CBProjectFunction · 0.90
VS2012ProjectFunction · 0.90
SESProjectFunction · 0.90
MDK45ProjectFunction · 0.90
IARProjectFunction · 0.90
UpdateProjectStructureFunction · 0.90
UpdateCprojectFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected