Fixed escape sequences

This commit is contained in:
Profitroll 2024-04-02 22:50:11 +02:00
parent 0593e9a4b6
commit bb755b2773
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
2 changed files with 3 additions and 6 deletions

View File

@ -145,7 +145,7 @@ def main():
), ),
} }
template.render(context) template.render(context, autoescape=True)
makedirs("output", exist_ok=True) makedirs("output", exist_ok=True)
template.save(Path("output", f"{lang}.docx")) template.save(Path("output", f"{lang}.docx"))
@ -175,8 +175,5 @@ if __name__ == "__main__":
) )
main() main()
if args.convert_output: if args.convert_output:
print( print("Converting everything to PDF...", flush=True)
f"Converting everything to PDF...",
flush=True,
)
convert(Path("output").absolute()) convert(Path("output").absolute())

View File

@ -26,7 +26,7 @@ def data_read(key: str, *args: str, locale: str) -> Any:
try: try:
output = nested_read(key, *args, data=locale_file) output = nested_read(key, *args, data=locale_file)
except (KeyError, ValueError): except (KeyError, ValueError):
default_file = locale_file = json_read(Path("data", f"default.json")) default_file = locale_file = json_read(Path("data", "default.json"))
try: try:
output = nested_read(key, *args, data=locale_file) output = nested_read(key, *args, data=locale_file)
except (KeyError, ValueError): except (KeyError, ValueError):