summaryrefslogtreecommitdiffstats
path: root/core/views/statistics.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-01-29 12:11:47 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-01-29 12:11:47 +0000
commitd9d4181dda0afbcc7c7d5da85853fc5a614dcd0c (patch)
treeeb7b669b57b1a27fdb17d2544289bbde578225f6 /core/views/statistics.py
parent071f68080c4e46049b89b4d78f635512df8d411b (diff)
downloadtroggle-d9d4181dda0afbcc7c7d5da85853fc5a614dcd0c.tar.gz
troggle-d9d4181dda0afbcc7c7d5da85853fc5a614dcd0c.tar.bz2
troggle-d9d4181dda0afbcc7c7d5da85853fc5a614dcd0c.zip
Add new survex import report
Diffstat (limited to 'core/views/statistics.py')
-rw-r--r--core/views/statistics.py28
1 files changed, 25 insertions, 3 deletions
diff --git a/core/views/statistics.py b/core/views/statistics.py
index 28bc721..65aca94 100644
--- a/core/views/statistics.py
+++ b/core/views/statistics.py
@@ -21,8 +21,12 @@ from troggle.parsers.people import (GetPersonExpeditionNameLookup,
foreign_friends)
#from django.views.generic.list import ListView
+'''Very simple report pages summarizing data about the whole set of expeditions and of
+the status of data inconsistencies
+'''
def therionissues(request):
+ """Page displaying contents of a file produced during data import"""
logname = "therionrefs.log"
logpath = (Path(settings.PYTHON_PATH, logname))
therionlog = []
@@ -40,11 +44,29 @@ def therionissues(request):
newlog.append(line)
return render(request, 'therionreport.html', {"therionlog":newlog})
-'''Very simple report pages summarizing data about the whole set of expeditions and of
-the status of data inconsistencies
-'''
+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")
+ else:
+ print(f"{logpath} NOT FOUND {len(contents)}")
+
+ for line in contents:
+ line = line.replace(" ", "&nbsp;")
+ newlog.append(line)
+ return render(request, 'survexreport.html', {"log":newlog})
+
def pathsreport(request):
+ """The CONSTANTs declared in the settings and localsettings and how they have
+ been evaluated for this specific installation - live """
pathsdict = OrderedDict()
try:
pathsdict = {