2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 22:57:14 +00:00

More public debug reports

This commit is contained in:
2023-01-29 12:41:50 +00:00
parent d9d4181dda
commit f73640522b
5 changed files with 50 additions and 19 deletions

View File

@@ -48,20 +48,25 @@ def surveximport(request):
"""Page displaying contents of a file produced during data import"""
logname = "svxlinear.log"
logpath = (Path(settings.PYTHON_PATH, logname))
contents = []
newlog = []
if Path(logpath).is_file:
with open(logpath, "r") as f:
contents = f.readlines()
print(f"{logpath} has {len(contents)} entries")
contents = f.read()
else:
print(f"{logpath} NOT FOUND {len(contents)}")
for line in contents:
line = line.replace(" ", " ")
newlog.append(line)
return render(request, 'survexreport.html', {"log":newlog})
return render(request, 'survexreport.html', {"log":contents})
def survexdebug(request):
"""Page displaying contents of a file produced during data import"""
logname = "svxblks.log"
logpath = (Path(settings.PYTHON_PATH, logname))
if Path(logpath).is_file:
with open(logpath, "r") as f:
contents = f.read()
else:
print(f"{logpath} NOT FOUND {len(contents)}")
return render(request, 'survexdebug.html', {"log":contents})
def pathsreport(request):