diff --git a/comicapi/comet.py b/comicapi/comet.py index 4dd273a..f823374 100644 --- a/comicapi/comet.py +++ b/comicapi/comet.py @@ -121,7 +121,7 @@ class CoMet: if credit["role"].lower() in set(self.editor_synonyms): ET.SubElement(root, "editor").text = str(credit["person"]) - utils.indent(root) + ET.indent(root) # wrap it in an ElementTree instance, and save as XML tree = ET.ElementTree(root) diff --git a/comicapi/comicinfoxml.py b/comicapi/comicinfoxml.py index ff3bd06..827cb9d 100644 --- a/comicapi/comicinfoxml.py +++ b/comicapi/comicinfoxml.py @@ -177,7 +177,7 @@ class ComicInfoXml: page_node = ET.SubElement(pages_node, "Page") page_node.attrib = dict(sorted(page_dict.items())) - utils.indent(root) + ET.indent(root) # wrap it in an ElementTree instance, and save as XML tree = ET.ElementTree(root) diff --git a/comicapi/utils.py b/comicapi/utils.py index 8dbfa66..bbe5a7a 100644 --- a/comicapi/utils.py +++ b/comicapi/utils.py @@ -33,23 +33,6 @@ class UtilsVars: already_fixed_encoding = False -def indent(elem, level=0): - # for making the XML output readable - i = "\n" + level * " " - if len(elem): - if not elem.text or not elem.text.strip(): - elem.text = i + " " - if not elem.tail or not elem.tail.strip(): - elem.tail = i - for ele in elem: - indent(ele, level + 1) - if not elem.tail or not elem.tail.strip(): - elem.tail = i - else: - if level and (not elem.tail or not elem.tail.strip()): - elem.tail = i - - def get_actual_preferred_encoding(): preferred_encoding = locale.getpreferredencoding() if platform.system() == "Darwin":