forgot to check if file existed before removing it award
This commit is contained in:
parent
f56607b3fc
commit
eaa6d34e2e
5
www.py
5
www.py
@ -39,6 +39,9 @@ def renderIndex(ct, latest):
|
||||
|
||||
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)
|
||||
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:
|
||||
file.write(render)
|
Loading…
Reference in New Issue
Block a user