Skip to content

Commit

Permalink
Debug information
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaus Thoden committed Mar 5, 2018
1 parent cab7a4f commit 096b1d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion prepare_tei.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ def main():

xml_cleaned = cleanup_xml(xml_tree)
xml_cleaned.write("cleaned.xml", pretty_print=True, xml_declaration=True, encoding="utf-8")
logging.info("Wrote cleanup.xml")

# first some modifications on a string object
xml_string = etree.tostring(xml_cleaned).decode('utf-8')
Expand All @@ -308,9 +309,10 @@ def main():

mod_string2 = convert_figures(mod_string)

debug_output = teifile.replace(".xml", "-modified.xml")
debug_output = args.teifile.replace(".xml", "-modified.xml")
with open(debug_output, "w") as debugfile:
debugfile.write(mod_string2)
logging.info("Wrote %s." % debug_output)

# check for wellformedness, read again as xml
xml_tree2 = etree.fromstring(mod_string2)
Expand Down

0 comments on commit 096b1d3

Please sign in to comment.