From f73640522bdd9d218fb00786b54b683da23a17b5 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 29 Jan 2023 12:41:50 +0000 Subject: More public debug reports --- core/views/statistics.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'core/views/statistics.py') diff --git a/core/views/statistics.py b/core/views/statistics.py index 65aca94..34512d8 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -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): -- cgit v1.2.3