2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 23:01:52 +00:00

fix error in test suite when full reset has not been done

This commit is contained in:
Philip Sargent 2023-08-25 21:49:05 +03:00
parent 3d51588cc1
commit f2a76da7e2

View File

@ -82,11 +82,16 @@ def therionissues(request):
newlog = []
if Path(logpath).is_file:
with open(logpath, "r") as f:
therionlog = f.readlines()
print(f"{logpath} has {len(therionlog)} entries")
try:
with open(logpath, "r") as f:
therionlog = f.readlines()
print(f"{logpath} has {len(therionlog)} entries")
except:
msg = f"{logpath} EXCEPTION opening or reading therion logfile. Run a full reset."
print(msg)
return render(request, "therionreport.html", {"therionlog": newlog})
else:
print(f"{logpath} NOT FOUND {len(therionlog)}")
print(f"{logpath} NOT FOUND: {len(therionlog)} entries")
for line in therionlog:
line = line.replace("! Un-parsed image filename:", "")