diagnosing missing entrance file

This commit is contained in:
Philip Sargent 2022-12-22 00:56:46 +00:00
parent a7a126dd55
commit f23764c486
4 changed files with 15 additions and 7 deletions

View File

@ -46,7 +46,7 @@ from django.db import transaction
from troggle.core.utils import get_process_memory
from troggle.core.models.caves import Cave, Entrance
from troggle.parsers.imports import import_caves, import_people, import_surveyscans, \
from troggle.parsers.imports import import_caves, import_people, import_surveyscans, import_ents, \
import_logbooks, import_logbook, import_QMs, import_survex, import_loadpos, import_drawingsfiles
if os.geteuid() == 0:
@ -343,6 +343,7 @@ def usage():
scans - the survey scans in all the wallets (must run before survex)
drawings - read in the Tunnel & Therion files - which scans the survey scans too
survex - read in the survex files - all the survex blocks and entrances x/y/z
ents - read just the entrances x/y/z (must run after survex)
dumplogbooks - Not used. write out autologbooks (not working? use http://localhost:8000/controlpanel )
logbook - read a single logbook. Defautl set in python code
@ -385,9 +386,8 @@ if __name__ == "__main__":
exit()
elif "init" in sys.argv:
jq.enq("reinit",reinit_db)
elif "test" in sys.argv:
jq.enq("caves",import_caves)
jq.enq("people",import_people)
elif "ents" in sys.argv:
jq.enq("survex",import_ents)
elif "test2" in sys.argv:
jq.enq("QMs",import_QMs)
jq.enq("drawings",import_drawingsfiles)

View File

@ -63,6 +63,13 @@ def import_survex():
with transaction.atomic():
troggle.parsers.survex.LoadPositions()
def import_ents():
# when this import is moved to the top with the rest it all crashes horribly
print(" - Survex entrances x/y/z Positions")
with transaction.atomic():
import troggle.parsers.survex
troggle.parsers.survex.LoadPositions()
def import_loadpos():
# when this import is moved to the top with the rest it all crashes horribly
import troggle.parsers.survex

View File

@ -69,13 +69,14 @@ class MapLocations(object):
def points(self):
for ent in Entrance.objects.all():
if ent.best_station():
print(f"{ent.filename}", end=", ")
try:
k = ent.caveandentrance_set.all()[0].cave
except:
message = f" ! Failed to get Cave linked to Entrance:{ent.name} from:{ent.filename} best:{ent.best_station()}"
message = f" ! Failed to get Cave linked to Entrance:{ent.name} from:{ent.filename} best:{ent.best_station()} {ent.caveandentrance_set.all()}"
DataIssue.objects.create(parser='entrances', message=message)
print(message)
raise
continue # skip this entrance
try:
areaName = k.getArea().short_name
except:

View File

@ -23,7 +23,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c
{% include 'wallet_table.html' %}
<br />
<table width=95%>
<tr><th>Wallet</th><th width=13%>Wallet Date</th><th>Wallet Name</th><th width=25%>>People</th><th>Scans</th><th>Survex blocks</th><th>Drawings using these scans</th></tr>
<tr><th>Wallet</th><th width=13%>Wallet Date</th><th>Wallet Name</th><th width=25%>People</th><th>Scans</th><th>Survex blocks</th><th>Drawings using these scans</th></tr>
{% for wallet in manywallets|dictsort:"walletname" %}
<tr>
<td style="padding:2px"><a href="{{wallet.get_absolute_url}}">{{wallet.walletname}}</a></td>