2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 04:27:45 +00:00

moved pending team setting from *date to *end

This commit is contained in:
2026-01-29 13:50:31 +00:00
parent 647e8f5698
commit 7a779555ac

View File

@@ -973,6 +973,28 @@ class LoadingSurvex:
stash_data_issue(parser='survex', message=message, url=None, sb=survexblock)
return expo
def process_pending_team(self, survexblock):
expo = survexblock.expedition
if teamnames := self.get_team_pending(survexblock._blockid):
for tm in teamnames:
if known_foreigner(tm):
message = f"- *team {expo.year} '{tm}' known foreigner *date (misordered) {survexblock.survexfile.path} ({survexblock})"
print(self.insp + message)
# stash_data_issue(parser='survex', message=message, url=None, sb=survexblock)
else:
pe = GetPersonExpeditionNameLookup(expo).get(tm.lower())
if pe:
put_person_on_trip(survexblock, pe, tm)
else:
message = f"! *team {expo.year} '{tm}' FAIL personexpedition lookup on *date {survexblock.survexfile.path} ({survexblock}) "
print(self.insp + message)
stash_data_issue(
parser="survex",
message=message,
url=None, sb=survexblock,
)
def LoadSurvexDate(self, survexblock, line):
"""We now have a valid date for this survexblock, so we now know the expo
it relates to and can use GetPersonExpeditionNameLookup(expo) to check whether
@@ -1007,25 +1029,9 @@ class LoadingSurvex:
print(self.insp + message)
stash_data_issue(parser='survex', message=message, url=None, sb=survexblock)
if teamnames := self.get_team_pending(survexblock._blockid):
for tm in teamnames:
if known_foreigner(tm):
message = f"- *team {expo.year} '{tm}' known foreigner *date (misordered) {survexblock.survexfile.path} ({survexblock}) in '{line}'"
print(self.insp + message)
# stash_data_issue(parser='survex', message=message, url=None, sb=survexblock)
else:
pe = GetPersonExpeditionNameLookup(expo).get(tm.lower())
if pe:
put_person_on_trip(survexblock, pe, tm)
#self.process_pending_team(survexblock)
else:
message = f"! *team {year} '{tm}' FAIL personexpedition lookup on *date {survexblock.survexfile.path} ({survexblock}) "
print(self.insp + message)
stash_data_issue(
parser="survex",
message=message,
url=None, sb=survexblock,
)
oline = line
perps = get_people_on_trip(survexblock) # perps used for diagnostic error messages only: they are to blame
@@ -2085,6 +2091,7 @@ class LoadingSurvex:
self.fix_undated(survexblock)
self.fix_anonymous(survexblock)
self.confirm_team_on_trip(survexblock)
self.process_pending_team(survexblock)
self.cache_survexblock(survexblock)
# POP state ++++++++++++++
popblock()
@@ -2153,9 +2160,6 @@ class LoadingSurvex:
print(f"FALLTHROUGH *{cmd=} {survexblock=} {survexblock.parent=}")
self.LoadSurvexFallThrough(survexblock, args, cmd)
# ...timing removed...
# this is a python generator idiom.
# see https://realpython.com/introduction-to-python-generators/
# this is the first use of generators in troggle (Oct.2022) and saves 21 MB of memory
@@ -2195,11 +2199,10 @@ class LoadingSurvex:
self.slength = slengthtotal
# At the end, save all cached survexblocks using bulk_update
# At the end of the whole (concatenated) file, save all cached survexblocks using bulk_update
blocks = []
for blockid in self._pending_block_saves:
blocks.append(self._pending_block_saves[blockid])
# blocks = list(getattr(self, '_pending_block_saves', set()))
if blocks:
# valid_blocks = []
# for block in blocks: