Skip to content
Snippets Groups Projects
Commit 3fc008c4 authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

much better formatting

parent 2cba9975
No related branches found
No related tags found
No related merge requests found
......@@ -21,9 +21,11 @@ def cert_to_xml(cert_doc):
}
cert_doc['DCC']['administrativeData']['dccSoftware'].append(s)
try:
xml = render_template(dcc_template, doc=cert_doc['DCC'], utils=utils)
xml = etree.canonicalize(prettify_xml(xml, indent=2, debug=False))
xml = render_template(dcc_template, doc=cert_doc['DCC'], utils=utils)
xml = etree.canonicalize(xml, with_comments=True, strip_text=True)
# Bad side-effect: adds XML declaration again
xml = prettify_xml(xml, indent=2, debug=False)
xml = etree.canonicalize(xml, with_comments=True)
except Exception as error:
xml = '<error>' + str(error) + '</error>\n'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment