We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b746e31 commit b9a4160Copy full SHA for b9a4160
utils/autotailor
@@ -23,6 +23,7 @@ import re
23
import sys
24
import pathlib
25
import xml.etree.ElementTree as ET
26
+import xml.dom.minidom
27
28
29
ALL_NS = {
@@ -110,10 +111,10 @@ class Tailoring:
110
111
change.set("idref", self._full_var_id(varname))
112
change.text = str(value)
113
- if location == "-":
114
- location = sys.stdout.buffer
115
-
116
- ET.ElementTree(root).write(location)
+ root_str = ET.tostring(root)
+ pretty_xml = xml.dom.minidom.parseString(root_str).toprettyxml()
+ with open(location, "w") if location != "-" else sys.stdout as f:
117
+ f.write(pretty_xml)
118
119
120
def parse_args():
0 commit comments