forgot to check if file existed before removing it award

This commit is contained in:
FzOrb 2024-12-26 11:48:57 +02:00
parent f56607b3fc
commit eaa6d34e2e

5
www.py
View File

@ -39,6 +39,9 @@ def renderIndex(ct, latest):
template = environment.get_template("index.html") template = environment.get_template("index.html")
render = template.render(ct=datetime.fromtimestamp(int(ct)), latest=latest, render=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), sha256Linux=sha256Linux, sha256Windows=sha256Windows, sha512Linux=sha512Linux, sha512Windows=sha512Windows, md5Linux=md5Linux, md5Windows=md5Windows) render = template.render(ct=datetime.fromtimestamp(int(ct)), latest=latest, render=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), sha256Linux=sha256Linux, sha256Windows=sha256Windows, sha512Linux=sha512Linux, sha512Windows=sha512Windows, md5Linux=md5Linux, md5Windows=md5Windows)
os.remove("./www/output/index.html") try:
os.remove("./www/output/index.html")
except FileNotFoundError:
pass
with open("./www/output/index.html", "x+") as file: with open("./www/output/index.html", "x+") as file:
file.write(render) file.write(render)