summaryrefslogtreecommitdiff
path: root/tools/generate-docs-nm-property-infos.py
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-02-09 20:02:17 +0100
committerThomas Haller <thaller@redhat.com>2022-02-10 08:41:19 +0100
commit069089cdf245a712dc936befa5f0169e1b465551 (patch)
tree12d6ce40ba2e92905ce2185cb74db553b56c0cd9 /tools/generate-docs-nm-property-infos.py
parentf21cb3065e0308076f9d67f425b7928541a03f86 (diff)
downloadNetworkManager-069089cdf245a712dc936befa5f0169e1b465551.tar.gz
tools: fix constructing XML by dropping broken pretty_xml()
I don't understand the code, but it mangles the XML. There is no difference in the markup we have so far. But if you have nested XML (like for description-docbook tag) there are cases where this is wrong. There is also no need to prettify anything. If you want pretty-formatted XML, do it yourself, for example with $ tidy --indent yes --indent-spaces 4 --indent-attributes yes --wrap-attributes yes --input-xml yes --output-xml yes src/libnm-client-impl/nm-property-infos-nmcli.xml I think this was initially done, because we had the tool in perl, and when migrating, we wanted to generate the exactly same output. And it was the same output, and it was fine for the input we have. But with different input, it's wrong. Drop it now. (cherry picked from commit 35599b4349c18b771d86ea6a7f577909cfcb7a2f)
Diffstat (limited to 'tools/generate-docs-nm-property-infos.py')
-rwxr-xr-xtools/generate-docs-nm-property-infos.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/tools/generate-docs-nm-property-infos.py b/tools/generate-docs-nm-property-infos.py
index 1790fd78ca..25aa272a69 100755
--- a/tools/generate-docs-nm-property-infos.py
+++ b/tools/generate-docs-nm-property-infos.py
@@ -123,18 +123,6 @@ def write_data(setting_node, parsed_data):
property_node.append(des)
-def pretty_xml(element, newline, level=0):
- if element:
- if (element.text is None) or element.text.isspace():
- element.text = newline
- else:
- element.text = newline + element.text.strip() + newline
- temp = list(element)
- for subelement in temp:
- subelement.tail = newline
- pretty_xml(subelement, newline, level=level + 1)
-
-
if len(sys.argv) < 4:
print("Usage: %s [plugin] [output-xml-file] [srcfiles]" % (sys.argv[0]))
exit(1)
@@ -152,6 +140,4 @@ for one_file in source_files:
setting_node.text = "\n"
scan_doc_comments(plugin, setting_node, one_file, start_tag, end_tag)
-pretty_xml(root_node, "\n")
-
ET.ElementTree(root_node).write(output)