new report on tehrion file parsing

This commit is contained in:
Philip Sargent 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 os.path
import re import re
from collections import OrderedDict from collections import OrderedDict
from pathlib import Path
import django.db.models import django.db.models
from django.db.models import Max, Min from django.db.models import Max, Min
@ -22,9 +23,22 @@ from troggle.parsers.people import (GetPersonExpeditionNameLookup,
#from django.views.generic.list import ListView #from django.views.generic.list import ListView
def therionissues(request): 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 '''Very simple report pages summarizing data about the whole set of expeditions and of
the status of data inconsistencies the status of data inconsistencies

View File

@ -24,7 +24,7 @@
<li><a href="/pathsreport">Folder paths used</a> -folders settings used by this troggle installation <li><a href="/pathsreport">Folder paths used</a> -folders settings used by this troggle installation
<li><a href="/aliases/2022">Expoer name aliases</a> -short names recognised by troggle <li><a href="/aliases/2022">Expoer name aliases</a> -short names recognised by troggle
<li><a href="/dataissues">Data Issues on Imports</a> - warnings and errors from the recent data import <li><a href="/dataissues">Data Issues on Imports</a> - warnings and errors from the recent data import
<li><a href="/therionissues">Therion Import issues</a> - warnings from the recent data import <li><a href="/therionissues">Therion Import issues</a> - warnings from the recent data import<br /><br />
<li><a href="/admin/">Django admin</a> - Deep magic access to all models and data <li><a href="/admin/">Django admin</a> - Deep magic access to all models and data
</ul> </ul>
<h3>This control panel is being redeveloped</h3> <h3>This control panel is being redeveloped</h3>
@ -36,13 +36,13 @@
<li>We are working on an on-line importer for new survex files - with syntax checking <li>We are working on an on-line importer for new survex files - with syntax checking
<li>Logbooks can only be <em>exported</em> in the current format. <li>Logbooks can only be <em>exported</em> in the current format.
</ol> </ol>
<p>Today (Dec. 2022) we use the <a href="/handbook/troggle/trogimport.html">databaseReset program</a> to import from the master files. This is run on the server itself only by nerds who remotely log in to the server using ssh. <p>Today (Jan. 2023) we use the <a href="/handbook/troggle/trogimport.html">databaseReset program</a> to import from the master files. This is run on the server itself only by nerds who remotely log in to the server using ssh.
<p>Before you even think about doing database imports, you should understand the implications on everyone else. See <a href="/handbook/troggle/trogindex.html">the Troggle documentation</a>. <p>Before you even think about doing database imports, you should understand the implications on everyone else. See <a href="/handbook/troggle/trogindex.html">the Troggle documentation</a>.
<p>As soon as you can cope, you should read the source code for <p>As soon as you can cope, you should read the source code for
<a href="http://expo.survex.com/repositories/troggle/.git/tree/databaseReset.py">databaseReset</a> to see what it does, as the details are not documented anywhere else yet. But at least the code is quite well commented. <a href="http://expo.survex.com/repositories/troggle/.git/tree/databaseReset.py">databaseReset</a> to see what it does, as the details are not documented anywhere else yet. But at least the code is quite well commented.
<p>The logbook export capability is used to convert an archaic logbook into the new logbook format. When all the old logbooks have been converted, we won't need this any more. (Neither will we need the old format parser). <p>The logbook export capability wass used to convert an archaic logbook into the current logbook format. It exports the logbook entries in the database into a new file, with the entries in date order. But there is no use for this capability now (Jan. 2023).
<div style="column-count: 2; "> <div style="column-count: 2; ">
<font style="color: silver"> <font style="color: silver">

View File

@ -4,8 +4,10 @@
{% block content %} {% block content %}
<h1>Expo Therion import issues report</h1> <h1>Expo Therion import issues report</h1>
<h3>! Un-parsed image filename</h3>
<p style="font-family: Consolas, Lucida Console, monospace;"> <p style="font-family: Consolas, Lucida Console, monospace;">
{% for line in theriondict %} {% for line in therionlog %}
{{line}}<br />
{% empty %} {% empty %}
<b>No Therion parsing output found. Re-import all drawings using databaseReset.py</b> <b>No Therion parsing output found. Re-import all drawings using databaseReset.py</b>
{% endfor %} {% endfor %}