1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-10 06:16:46 +00:00
tcl_ota_check/tcllib/xmltools.py

15 lines
293 B
Python
Raw Normal View History

2018-02-03 20:40:17 +00:00
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
2018-02-03 20:40:17 +00:00
# pylint: disable=C0111,C0326,C0103
2018-02-03 21:25:26 +00:00
"""XML tools."""
import xml.dom.minidom
2018-02-03 20:24:36 +00:00
def pretty_xml(xmlstr):
"""Prettify input XML with ``xml.dom.minidom``."""
mdx = xml.dom.minidom.parseString(xmlstr)
return mdx.toprettyxml(indent=" ")