new report on tehrion file parsing

This commit is contained in:
2023-01-26 23:36:56 +00:00
parent 719e0fe918
commit 75834902f2
3 changed files with 22 additions and 6 deletions

View File

@@ -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