2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 15:21:52 +00:00

moer people/logbook improvements

This commit is contained in:
Philip Sargent 2023-09-05 14:35:56 +03:00
parent f3d5a389eb
commit 0ea8fadaeb
3 changed files with 25 additions and 27 deletions

View File

@ -68,7 +68,6 @@ archaic_wallets = [
'1995-96kh', '1995-96kh',
'1996-1999NotKHbook', '1996-1999NotKHbook',
'1997-99kh', '1997-99kh',
'1999',
'loosepages', 'loosepages',
] ]
class Wallet(models.Model): class Wallet(models.Model):

View File

@ -130,7 +130,7 @@ def reset_trip_id(date):
# print(already, n, tid) # print(already, n, tid)
return tid return tid
rx_tripperson = re.compile(r"(?i)<u>(.*?)</u>$") rx_tripauthor = re.compile(r"(?i)<u>(.*?)</u>$")
rx_round_bracket = re.compile(r"[\(\[].*?[\)\]]") rx_round_bracket = re.compile(r"[\(\[].*?[\)\]]")
def GetTripPersons(trippeople, expedition, logtime_underground, tid=None): def GetTripPersons(trippeople, expedition, logtime_underground, tid=None):
@ -143,11 +143,14 @@ def GetTripPersons(trippeople, expedition, logtime_underground, tid=None):
for tripperson in re.split(r",|\+|&amp;|&(?!\w+;)| and ", trippeople): for tripperson in re.split(r",|\+|&amp;|&(?!\w+;)| and ", trippeople):
tripperson = tripperson.strip() tripperson = tripperson.strip()
# author_u = re.match(r"(?i)<u>(.*?)</u>$", tripperson) # author_u = re.match(r"(?i)<u>(.*?)</u>$", tripperson)
author_u = rx_tripperson.match(tripperson) author_u = rx_tripauthor.match(tripperson)
if author_u: if author_u:
tripperson = author_u.group(1).strip() tripperson = author_u.group(1).strip()
if tripperson: if tripperson:
if tripperson[0] != "*": # a name prefix of "*" is special if tripperson[0] == "*": # a name prefix of "*" is special
guests.append(tripperson)
# print(f" ! - {expedition.year} * GUEST : {tripperson}")
else:
tripperson = re.sub(rx_round_bracket, "", tripperson).strip() tripperson = re.sub(rx_round_bracket, "", tripperson).strip()
# Whacky aliases all resolved in GetPersonExpeditionNameLookup() # Whacky aliases all resolved in GetPersonExpeditionNameLookup()
@ -172,16 +175,12 @@ def GetTripPersons(trippeople, expedition, logtime_underground, tid=None):
raise raise
if author_u: if author_u:
author = personyear author = personyear
else: # *guest
guests.append(tripperson)
# print(f" ! - {expedition.year} * GUEST : {tripperson}")
if not author: if not author:
if not res: if not res:
return "", 0, "" return "", 0, ""
author = res[-1][0] # the previous valid person and a time of 0 hours author = res[-1][0] # the last valid person and a time of 0 hours. BODGE. This gets written into the archive file as Truth.
# print(f" - {tid} [{author.person}] '{res[0][0].person}'...")
return res, author, guests return res, author, guests
def tidy_time_underground(logtime_underground): def tidy_time_underground(logtime_underground):

View File

@ -138,32 +138,32 @@ def who_is_this(year, possibleid):
global foreign_friends global foreign_friends
foreign_friends = [ foreign_friends = [
"P. Jeutter", "Aiko",
"K. Jäger", "Arndt Karger",
"S. Steinberger",
"R. Seebacher",
"Dominik Jauch", "Dominik Jauch",
"Florian Gruner",
"Fritz Mammel", "Fritz Mammel",
"Gunter Graf",
"Helmut Stopka-Ebeler",
"K. Jäger",
"Kai Schwekend",
"Karl Gaisberger",
"Marcus Scheuerman", "Marcus Scheuerman",
"Mark Morgan",
"P. Jeutter",
"R. Seebacher",
"Regina Kaiser",
"Robert Seebacher",
"S. Steinberger",
"Sepp Steinberger",
"Thilo Müller",
"Uli Schütz", "Uli Schütz",
"Wieland Scheuerle", "Wieland Scheuerle",
"Arndt Karger",
"Kai Schwekend",
"Regina Kaiser",
"Thilo Müller",
"Wieland Scheuerle",
"Florian Gruner",
"Helmut Stopka-Ebeler",
"Aiko",
"Mark Morgan",
] ]
def known_foreigner(id): def known_foreigner(id):
"""If this someone from ARGE or a known Austrian? Name has to be exact, no soft matching """If this someone from ARGE or a known Austrian? Name has to be exact, no soft matching
"""
APPARENTLY NOT YET USED? Yes it is: in logbook Blog parsing
instead foreigners have names prefixed by * in the logbook.html ?"""
global foreign_friends global foreign_friends
if id in foreign_friends: if id in foreign_friends: