diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-01-29 12:41:50 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-01-29 12:41:50 +0000 |
commit | f73640522bdd9d218fb00786b54b683da23a17b5 (patch) | |
tree | 671e2d9506b8920b58f88e35cdce8fb517352ffe /core/views/statistics.py | |
parent | d9d4181dda0afbcc7c7d5da85853fc5a614dcd0c (diff) | |
download | troggle-f73640522bdd9d218fb00786b54b683da23a17b5.tar.gz troggle-f73640522bdd9d218fb00786b54b683da23a17b5.tar.bz2 troggle-f73640522bdd9d218fb00786b54b683da23a17b5.zip |
More public debug reports
Diffstat (limited to 'core/views/statistics.py')
-rw-r--r-- | core/views/statistics.py | 23 |
1 files changed, 14 insertions, 9 deletions
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): |