2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 03:07:40 +00:00

QM report pages now not crashing, working..

This commit is contained in:
Philip Sargent
2022-07-05 15:38:23 +03:00
parent 33eb91346c
commit 779afc2f2a
6 changed files with 41 additions and 8 deletions

View File

@@ -32,6 +32,7 @@ def parseCaveQMs(cave,inputFile):
if cave=='204-steinBH':
try:
steinBr=Cave.objects.get(official_name="Steinbrückenhöhle")
caveid = steinBr
except Cave.DoesNotExist:
message = f' ! - {qmPath} Steinbruckenhoehle is not in the database. Please run cave parser'
print(message)
@@ -40,6 +41,7 @@ def parseCaveQMs(cave,inputFile):
elif cave=='234-Hauch':
try:
hauchHl=Cave.objects.get(official_name="Hauchhöhle")
caveid = hauchHl
except Cave.DoesNotExist:
message = f' ! - {qmPath} Hauchhoehle is not in the database. Please run cave parser'
print(message)
@@ -48,6 +50,7 @@ def parseCaveQMs(cave,inputFile):
elif cave =='161-KH':
try:
kh=Cave.objects.get(official_name="Kaninchenhöhle")
caveid = kh
except Cave.DoesNotExist:
message = f' ! - {qmPath} KH is not in the database. Please run cave parser'
print(message)
@@ -82,6 +85,7 @@ def parseCaveQMs(cave,inputFile):
newQM = QM()
newQM.found_by=placeholder
newQM.number=QMnum
newQM.cave = caveid
if line[1]=="Dig":
newQM.grade="D"
else:
@@ -120,7 +124,7 @@ def parseCaveQMs(cave,inputFile):
continue
def parse_KH_QMs(kh, inputFile):
"""import QMs from the 1623-161 (Kaninchenh<EFBFBD>hle) html pages
"""import QMs from the 1623-161 (Kaninchenhohle) html pages, different format
"""
khQMs=open(os.path.join(settings.EXPOWEB, inputFile),'r')
khQMs=khQMs.readlines()
@@ -140,6 +144,7 @@ def parse_KH_QMs(kh, inputFile):
'number':res['number']
}
nonLookupArgs={
'cave': kh,
'grade':res['grade'],
'nearest_station_name':res['nearest_station'],
'location_description':res['description']