summaryrefslogtreecommitdiffstats
path: root/parsers/logbooks.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-08-07 23:10:30 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-08-07 23:10:30 +0300
commiteec04266120db7564f4d3803922f7df0012d9e52 (patch)
tree0c40ebdbbb624472d09244ac3dc39796d8b523ee /parsers/logbooks.py
parent65936bdce5bfe2224c5d391dad8c77394f01ab91 (diff)
downloadtroggle-eec04266120db7564f4d3803922f7df0012d9e52.tar.gz
troggle-eec04266120db7564f4d3803922f7df0012d9e52.tar.bz2
troggle-eec04266120db7564f4d3803922f7df0012d9e52.zip
Cope with ARGE people
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r--parsers/logbooks.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py
index 50df6cf..59711c4 100644
--- a/parsers/logbooks.py
+++ b/parsers/logbooks.py
@@ -58,7 +58,7 @@ LOGBOOKS_DIR = "years" # subfolder of settings.EXPOWEB
ENTRIES = {
"2023": 53,
- "2022": 90,
+ "2022": 93,
"2019": 55,
"2018": 95,
"2017": 74,
@@ -128,12 +128,22 @@ def GetTripPersons(trippeople, expedition, logtime_underground, tid=None):
tripperson = re.sub(rx_round_bracket, "", tripperson).strip()
# Whacky aliases all handled in GetPersonExpeditionNameLookup()
- personyear = GetPersonExpeditionNameLookup(expedition).get(tripperson.lower())
- if not personyear:
- message = f" ! - {expedition.year} No name match for: '{tripperson}' in entry {tid=} for this expedition year."
+ try:
+ personyear = GetPersonExpeditionNameLookup(expedition).get(tripperson.lower())
+ if not personyear:
+ if known_foreigner(tripperson):
+ message = f" ! - {expedition.year} Known foreigner: '{tripperson}' in entry {tid=}"
+ print(message)
+ else:
+ message = f" ! - {expedition.year} No name match for: '{tripperson}' in entry {tid=} for this year."
+ print(message)
+ DataIssue.objects.create(parser="logbooks", message=message)
+ res.append((personyear, logtime_underground))
+ except:
+ message = f" ! - {expedition.year} EXCEPTION: '{tripperson}' in entry {tid=} for this year."
print(message)
DataIssue.objects.create(parser="logbooks", message=message)
- res.append((personyear, logtime_underground))
+ raise
if author_u:
author = personyear
else:
@@ -175,7 +185,7 @@ def tidy_trip_persons(trippeople, title, expedition, logtime_underground, tid):
DataIssue.objects.create(parser="logbooks", message=message)
print(message)
# raise
- return
+ return "", ""
if not author:
message = f" ! - {expedition.year} Warning: logentry: {title} - no expo member author for entry '{tid}'"