diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-01-29 12:11:47 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-01-29 12:11:47 +0000 |
commit | d9d4181dda0afbcc7c7d5da85853fc5a614dcd0c (patch) | |
tree | eb7b669b57b1a27fdb17d2544289bbde578225f6 /core | |
parent | 071f68080c4e46049b89b4d78f635512df8d411b (diff) | |
download | troggle-d9d4181dda0afbcc7c7d5da85853fc5a614dcd0c.tar.gz troggle-d9d4181dda0afbcc7c7d5da85853fc5a614dcd0c.tar.bz2 troggle-d9d4181dda0afbcc7c7d5da85853fc5a614dcd0c.zip |
Add new survex import report
Diffstat (limited to 'core')
-rw-r--r-- | core/utils.py | 2 | ||||
-rw-r--r-- | core/views/statistics.py | 28 |
2 files changed, 27 insertions, 3 deletions
diff --git a/core/utils.py b/core/utils.py index 0b18e3b..29c2643 100644 --- a/core/utils.py +++ b/core/utils.py @@ -205,6 +205,8 @@ def save_carefully(objectType, lookupAttribs={}, nonLookupAttribs={}): We are not using new_since_parsing - it is a fossil from Aaron Curtis's design in 2006. So it is always false. NOTE: this takes twice as long as simply creating a new object with the given values. + + As of Jan.2023 this function is not used anywhere in troggle. """ try: 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(" ", " ") + 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 = { |