diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/views/statistics.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/views/statistics.py b/core/views/statistics.py index 726aebb..28bc721 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -3,6 +3,7 @@ import operator import os.path import re from collections import OrderedDict +from pathlib import Path import django.db.models from django.db.models import Max, Min @@ -22,9 +23,22 @@ from troggle.parsers.people import (GetPersonExpeditionNameLookup, #from django.views.generic.list import ListView def therionissues(request): - theriondict = {} + logname = "therionrefs.log" + logpath = (Path(settings.PYTHON_PATH, logname)) + therionlog = [] + newlog = [] - return render(request, 'therionreport.html', {"theriondict":theriondict}) + if Path(logpath).is_file: + with open(logpath, "r") as f: + therionlog = f.readlines() + print(f"{logpath} has {len(therionlog)} entries") + else: + print(f"{logpath} NOT FOUND {len(therionlog)}") + + for line in therionlog: + line = line.replace("! Un-parsed image filename:", "") + 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 |