summaryrefslogtreecommitdiffstats
path: root/core/views/statistics.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/statistics.py')
-rw-r--r--core/views/statistics.py23
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):