summaryrefslogtreecommitdiffstats
path: root/parsers/logbooks.py
diff options
context:
space:
mode:
authorSam Wenham <sam@wenhams.co.uk>2019-07-29 11:36:24 +0100
committerSam Wenham <sam@wenhams.co.uk>2019-07-29 11:36:24 +0100
commitc74852b60ba954661b92aae98b79f62d6cb9a4d7 (patch)
treefbc02a56f24a8f75aaeed2dce90029b2e0e61123 /parsers/logbooks.py
parent2d7892e3b16841e494d43c5e0b25fbe599af777d (diff)
parenta26109cb3006dd64e1bec38100397ad636813e98 (diff)
downloadtroggle-c74852b60ba954661b92aae98b79f62d6cb9a4d7.tar.gz
troggle-c74852b60ba954661b92aae98b79f62d6cb9a4d7.tar.bz2
troggle-c74852b60ba954661b92aae98b79f62d6cb9a4d7.zip
Merge branch 'master' of ssh://expo.survex.com/~/troggle
# Conflicts: # README.txt
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r--parsers/logbooks.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py
index 12124ca..e5817a6 100644
--- a/parsers/logbooks.py
+++ b/parsers/logbooks.py
@@ -25,9 +25,10 @@ from utils import save_carefully
#
# the logbook loading section
#
-def GetTripPersons(trippeople, expedition, logtime_underground):
+def GetTripPersons(trippeople, expedition, logtime_underground):
res = [ ]
author = None
+ round_bracket_regex = re.compile(r"[\(\[].*?[\)\]]")
for tripperson in re.split(r",|\+|&amp;|&(?!\w+;)| and ", trippeople):
tripperson = tripperson.strip()
mul = re.match(r"<u>(.*?)</u>$(?i)", tripperson)
@@ -35,6 +36,7 @@ def GetTripPersons(trippeople, expedition, logtime_underground):
tripperson = mul.group(1).strip()
if tripperson and tripperson[0] != '*':
#assert tripperson in personyearmap, "'%s' << %s\n\n %s" % (tripperson, trippeople, personyearmap)
+ tripperson = re.sub(round_bracket_regex, "", tripperson).strip()
personyear = GetPersonExpeditionNameLookup(expedition).get(tripperson.lower())
if not personyear:
print(" - No name match for: '%s'" % tripperson)
@@ -172,8 +174,8 @@ def Parseloghtmltxt(year, expedition, txt):
tripid, tripid1, tripdate, trippeople, triptitle, triptext, tu = s.groups()
ldate = ParseDate(tripdate.strip(), year)
#assert tripid[:-1] == "t" + tripdate, (tripid, tripdate)
- #trippeople = re.sub(r"Ol(?!l)", "Olly", trippeople)
- #trippeople = re.sub(r"Wook(?!e)", "Wookey", trippeople)
+ #trippeople = re.sub(r"Ol(?!l)", "Olly", trippeople)
+ #trippeople = re.sub(r"Wook(?!e)", "Wookey", trippeople)
triptitles = triptitle.split(" - ")
if len(triptitles) >= 2:
tripcave = triptitles[0]