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

trying to isolate bug in letter setting on ents

This commit is contained in:
2023-08-03 16:11:46 +03:00
parent 0dfe9d94b2
commit e101f4ed2f
8 changed files with 68 additions and 35 deletions

View File

@@ -91,7 +91,7 @@ def set_dummy_entrance(id, slug, cave, msg="DUMMY"):
# try:
# entrance = dummy_entrance(id, slug, msg="DUMMY")
# entrances_xslug[slug] = entrance
# CaveAndEntrance.objects.update_or_create(cave=cave, entrance_letter="", entrance=entrance)
# CaveAndEntrance.objects.update_or_create(cave=cave, entranceletter="", entrance=entrance)
# pass
# except:
# message = f' ! Entrance Dummy setting failure, slug:"{slug}" cave id :"{id}" '
@@ -363,6 +363,7 @@ def validate_station(station):
def read_entrance(filename, ent=None):
"""Reads an entrance description from the .html file.
Runs on initial full import, and also whenever an entrance is edited online.
If not called as part of initial import, then the global lists will not be correct
but this is OK, a search will find them in the db.
@@ -503,7 +504,7 @@ def read_cave(filename, cave=None):
if eslug.endswith('a b'):
message = f' - Entrance has weird name slug:"{eslug}" cave:"{cave}" caveslug:"{slug}" filename:"cave_data/{filename}"'
DataIssue.objects.create(parser="xEntrances", message=message, url=f"{cave.area}/{cave.area}-{cave.url}_cave_edit/")
print(message)
# print(message)
letter = getXML(e, "letter", maxItems=1, context=context)[0]
@@ -540,7 +541,7 @@ def read_cave(filename, cave=None):
try:
# this fails if there is not an unambiguous letter set.
CaveAndEntrance.objects.update_or_create(
cave=cave, entrance_letter=letter, entrance=entrance
cave=cave, entranceletter=letter, entrance=entrance
)
except:
print(f"! Entrance setting failure {slug}")
@@ -714,7 +715,7 @@ def read_cave(filename, cave=None):
if description_file[0]: # if not an empty string
message = f' - {slug:12} Note (not an error): complex description filename "{description_file[0]}" inside "cave_data/{filename}"'
DataIssue.objects.create(parser="caves ok", message=message, url=f"/{slug}_cave_edit/")
print(message)
# print(message)
if not (Path(EXPOWEB) / description_file[0]).is_file():
message = f' ! {slug:12} description filename "{EXPOWEB}/{description_file[0]}" does not refer to a real file'