mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 12:37:10 +00:00
tidying
This commit is contained in:
@@ -472,6 +472,13 @@ def read_entrance(filename, ent=None):
|
||||
contents = f.read()
|
||||
context = filename
|
||||
|
||||
# validate filename, check areacode
|
||||
ent_area = filename[:4]
|
||||
if ent_area not in AREACODES:
|
||||
message = f'! BAD AREA CODE in "{filename}". Not recognised.'
|
||||
DataIssue.objects.create(parser="entrances", message=message, url=f"/entrance_data/{filename}_edit")
|
||||
print(message)
|
||||
|
||||
entrancecontentslist = getXML(contents, "entrance", maxItems=1, context=context)
|
||||
if len(entrancecontentslist) != 1:
|
||||
message = f'! BAD ENTRANCE DATA in "{filename}". More than one entrance. Edit file manually, click.'
|
||||
@@ -840,7 +847,9 @@ def readcaves():
|
||||
with open(fpending, "r") as fo:
|
||||
cids = fo.readlines()
|
||||
for cid in cids:
|
||||
pending.add(cid.strip().rstrip("\n"))
|
||||
pcaveid = cid.strip().rstrip("\n")
|
||||
if pcaveid !="":
|
||||
pending.add(pcaveid)
|
||||
|
||||
with transaction.atomic():
|
||||
print(" - Deleting Caves and Entrances")
|
||||
|
||||
Reference in New Issue
Block a user