2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 18:27:08 +00:00

make more robust against data error

This commit is contained in:
2025-02-19 18:32:58 +02:00
parent a950cc60d9
commit aeaf7cf57f
4 changed files with 18 additions and 11 deletions

View File

@@ -22,6 +22,12 @@ It also scans the Loser repo for all the svx files, which it loads individually
"""
todo = """
- Rewrite regexes to use .groupdict instead of .group,
easier to understand and maintain
https://mathspp.com/blog/til/re-match-groupdict
- replace hard-coded instuments list with reding an editable textfile in expoweb.
- Obscure bug in the *team inheritance and rootblock initialization needs tracking down,
probably in the team cache which should NOT be global, but should be an instance variable of
LoadingSurvex
@@ -75,10 +81,6 @@ class SurvexLeg:
clino = 0.0
def datewallet(w, earliest):
"""Gets the date of the youngest survexblock associated with the wallet
REFACTOR this to do the whole date-getting task
@@ -163,7 +165,7 @@ def get_people_on_trip(survexblock):
return list(set(people))
# THIS SHOULD NOT BE GLOBAL ! SHould be per instance of file loader
# THIS SHOULD NOT BE GLOBAL ! Should be per instance of file loader
trip_person_record = {} # indexed by (survexblock, personexpedition) - so never needs cleaning out
trip_team_cache = {} # indexed by survexblock, so never needs cleaning out
def put_person_on_trip(survexblock, personexpedition, tm):