Skip to content

Commit

Permalink
Add a newline at the end of the file when exporting pretty XML
Browse files Browse the repository at this point in the history
We've always had newlines but lost them when switching to ElementTree.indent()
  • Loading branch information
MartinHammarstedt committed Oct 8, 2024
1 parent 7ca9695 commit 07d8e95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sparv/modules/xml_export/pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def pretty(source_file: SourceFilename = SourceFilename(),

# Write XML to file
with open(out, mode="w", encoding="utf-8") as outfile:
outfile.write(xmlstr)
print(xmlstr, file=outfile) # Use print() to get a newline at the end of the file
logger.info("Exported: %s", out)


Expand Down
2 changes: 1 addition & 1 deletion sparv/modules/xml_export/scrambled.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def scrambled(source_file: SourceFilename = SourceFilename(),

# Write XML to file
with open(out, mode="w", encoding="utf-8") as outfile:
outfile.write(xmlstr)
print(xmlstr, file=outfile) # Use print() to get a newline at the end of the file
logger.info("Exported: %s", out)


Expand Down

0 comments on commit 07d8e95

Please sign in to comment.