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:
@@ -972,7 +972,29 @@ class LoadingSurvex:
|
||||
print(self.insp + message)
|
||||
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
|
||||
@@ -990,7 +1012,7 @@ class LoadingSurvex:
|
||||
caves-1623/161/triassic/henricat.svx has the *date after all the team members
|
||||
in each survexblock
|
||||
"""
|
||||
|
||||
|
||||
def setdate_on_survexblock(year):
|
||||
"""Either *date comes before any *team, in which case there are no prior
|
||||
PersonRoles attached, or
|
||||
@@ -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)
|
||||
|
||||
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,
|
||||
)
|
||||
#self.process_pending_team(survexblock)
|
||||
|
||||
|
||||
|
||||
oline = line
|
||||
perps = get_people_on_trip(survexblock) # perps used for diagnostic error messages only: they are to blame
|
||||
@@ -1796,7 +1802,7 @@ class LoadingSurvex:
|
||||
|
||||
### HORRIBLE HACK, replace with cache
|
||||
hack_save(survexblock)
|
||||
### HORRIBLE HACK, replace with cache
|
||||
### HORRIBLE HACK, replace with cache
|
||||
|
||||
try:
|
||||
qm = QM.objects.create(
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user