forked from expo/troggle
* prefix documented
This commit is contained in:
parent
9abfcdd091
commit
13f0c6f988
@ -119,11 +119,12 @@ def GetTripPersons(trippeople, expedition, logtime_underground, tid=None):
|
|||||||
|
|
||||||
for tripperson in re.split(r",|\+|&|&(?!\w+;)| and ", trippeople):
|
for tripperson in re.split(r",|\+|&|&(?!\w+;)| and ", trippeople):
|
||||||
tripperson = tripperson.strip()
|
tripperson = tripperson.strip()
|
||||||
# mul = re.match(r"(?i)<u>(.*?)</u>$", tripperson)
|
# author_u = re.match(r"(?i)<u>(.*?)</u>$", tripperson)
|
||||||
mul = rx_tripperson.match(tripperson)
|
author_u = rx_tripperson.match(tripperson)
|
||||||
if mul:
|
if author_u:
|
||||||
tripperson = mul.group(1).strip()
|
tripperson = author_u.group(1).strip()
|
||||||
if tripperson and tripperson[0] != "*":
|
if tripperson:
|
||||||
|
if tripperson[0] != "*": # a name prefix of "*" is special
|
||||||
tripperson = re.sub(rx_round_bracket, "", tripperson).strip()
|
tripperson = re.sub(rx_round_bracket, "", tripperson).strip()
|
||||||
|
|
||||||
# Whacky aliases all handled in GetPersonExpeditionNameLookup()
|
# Whacky aliases all handled in GetPersonExpeditionNameLookup()
|
||||||
@ -133,8 +134,12 @@ def GetTripPersons(trippeople, expedition, logtime_underground, tid=None):
|
|||||||
print(message)
|
print(message)
|
||||||
DataIssue.objects.create(parser="logbooks", message=message)
|
DataIssue.objects.create(parser="logbooks", message=message)
|
||||||
res.append((personyear, logtime_underground))
|
res.append((personyear, logtime_underground))
|
||||||
if mul:
|
if author_u:
|
||||||
author = personyear
|
author = personyear
|
||||||
|
else:
|
||||||
|
# a person but with * prefix. Ignored everywhere.
|
||||||
|
print(f" ! - {expedition.year} * person : {tripperson}")
|
||||||
|
|
||||||
if not author:
|
if not author:
|
||||||
if not res:
|
if not res:
|
||||||
return "", 0
|
return "", 0
|
||||||
@ -160,7 +165,7 @@ def tidy_time_underground(logtime_underground):
|
|||||||
logtime_underground = 0
|
logtime_underground = 0
|
||||||
return logtime_underground
|
return logtime_underground
|
||||||
|
|
||||||
def tidy_trip_persons(trippeople, expedition, logtime_underground, tid):
|
def tidy_trip_persons(trippeople, title, expedition, logtime_underground, tid):
|
||||||
try:
|
try:
|
||||||
trippersons, author = GetTripPersons(trippeople, expedition, logtime_underground, tid=tid)
|
trippersons, author = GetTripPersons(trippeople, expedition, logtime_underground, tid=tid)
|
||||||
# print(f" - {author} - {logtime_underground}")
|
# print(f" - {author} - {logtime_underground}")
|
||||||
@ -372,7 +377,7 @@ def parser_html(year, expedition, txt, seq=""):
|
|||||||
dupl[check] = 1
|
dupl[check] = 1
|
||||||
|
|
||||||
tu = tidy_time_underground(tu)
|
tu = tidy_time_underground(tu)
|
||||||
trippersons, author = tidy_trip_persons(trippeople, expedition, tu, tid)
|
trippersons, author = tidy_trip_persons(trippeople, triptitle, expedition, tu, tid)
|
||||||
tripcave = tidy_trip_cave(place)
|
tripcave = tidy_trip_cave(place)
|
||||||
tripcontent = tidy_trip_image_urls(tripcontent, ldate)
|
tripcontent = tidy_trip_image_urls(tripcontent, ldate)
|
||||||
tid = tidy_tid(tid, triptitle)
|
tid = tidy_tid(tid, triptitle)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user