MCPcopy Create free account
hub / github.com/ActiveState/code / prettify

Function prettify

recipes/Python/579019_Python_AST_to_XML/recipe-579019.py:21–23  ·  view source on GitHub ↗
(xml_string)

Source from the content-addressed store, hash-verified

19 from xml.etree import ElementTree as etree
20
21def prettify(xml_string):
22 reparsed = minidom.parseString(xml_string)
23 return reparsed.toprettyxml(indent=" ")
24
25class ast2xml(ast.NodeVisitor):
26 def __init__(self):

Callers 1

mainFunction · 0.70

Calls 1

parseStringMethod · 0.80

Tested by

no test coverage detected