diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-10-15 18:39:00 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-10-15 18:39:00 +0300 |
commit | a786f4813fe50dd3b7603e94ffdfd9f5bb1d64df (patch) | |
tree | 89586963ebd3d0a705f302b6a68198b1bfa29800 /parsers | |
parent | c51c2326feb2a05629ca720fed31740cf73a8aa3 (diff) | |
download | troggle-a786f4813fe50dd3b7603e94ffdfd9f5bb1d64df.tar.gz troggle-a786f4813fe50dd3b7603e94ffdfd9f5bb1d64df.tar.bz2 troggle-a786f4813fe50dd3b7603e94ffdfd9f5bb1d64df.zip |
tidying
Diffstat (limited to 'parsers')
-rw-r--r-- | parsers/caves.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/parsers/caves.py b/parsers/caves.py index 1178399..d69273f 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -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") |