forked from expo/troggle
make compatible with python 3.11 as well as 3.10
This commit is contained in:
@@ -81,20 +81,23 @@ def set_trip_id(year, seq):
|
||||
tid= f"{year}_s{seq:02d}"
|
||||
return tid
|
||||
|
||||
rx_tripperson = re.compile(r'(?i)<u>(.*?)</u>$')
|
||||
rx_round_bracket = re.compile(r"[\(\[].*?[\)\]]")
|
||||
|
||||
|
||||
def GetTripPersons(trippeople, expedition, logtime_underground, tid=None):
|
||||
res = [ ]
|
||||
author = None
|
||||
round_bracket_regex = re.compile(r"[\(\[].*?[\)\]]")
|
||||
#print(f'# {tid}')
|
||||
|
||||
for tripperson in re.split(r",|\+|&|&(?!\w+;)| and ", trippeople):
|
||||
tripperson = tripperson.strip()
|
||||
mul = re.match(r"<u>(.*?)</u>$(?i)", tripperson)
|
||||
# mul = re.match(r"(?i)<u>(.*?)</u>$", tripperson)
|
||||
mul = rx_tripperson.match(tripperson)
|
||||
if mul:
|
||||
tripperson = mul.group(1).strip()
|
||||
if tripperson and tripperson[0] != '*':
|
||||
tripperson = re.sub(round_bracket_regex, "", tripperson).strip()
|
||||
tripperson = re.sub(rx_round_bracket, "", tripperson).strip()
|
||||
|
||||
if tripperson =="Wiggy":
|
||||
tripperson = "Phil Wigglesworth"
|
||||
@@ -134,6 +137,7 @@ def EnterLogIntoDbase(date, place, title, text, trippeople, expedition, logtime_
|
||||
DataIssue.objects.create(parser='logbooks', message=message)
|
||||
logdataissues["title"]=message
|
||||
print(message)
|
||||
raise
|
||||
return
|
||||
|
||||
if not author:
|
||||
|
||||
Reference in New Issue
Block a user