Passed
Push — master ( a643f9...78d900 )
by Markus
01:45
created

tcllib.xmltools.pretty_xml()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
4
# pylint: disable=C0111,C0326,C0103
5
6
"""XML tools."""
7
8
import xml.dom.minidom
9
10
11
def pretty_xml(xmlstr):
12
    """Prettify input XML with ``xml.dom.minidom``."""
13
    mdx = xml.dom.minidom.parseString(xmlstr)
14
    return mdx.toprettyxml(indent="  ")
15