summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--databaseReset.py2
-rw-r--r--parsers/logbooks.py4
-rw-r--r--parsers/people.py11
-rw-r--r--parsers/survex.py12
4 files changed, 18 insertions, 11 deletions
diff --git a/databaseReset.py b/databaseReset.py
index 0e22f86..2325f76 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -268,7 +268,7 @@ class JobQueue:
self.results["TOTAL"] = []
for i in range(len(self.results["date"])):
self.format_date(i)
- print(i, self.compute_total(i))
+ # print(i, self.compute_total(i))
self.results["TOTAL"].append(self.compute_total(i))
for j in self.results_order:
diff --git a/parsers/logbooks.py b/parsers/logbooks.py
index a411848..ae6c75f 100644
--- a/parsers/logbooks.py
+++ b/parsers/logbooks.py
@@ -58,7 +58,7 @@ LOGBOOK_PARSER_SETTINGS = {
LOGBOOKS_DIR = "years" # subfolder of settings.EXPOWEB
ENTRIES = {
- "2024": 125,
+ "2024": 126,
"2023": 131,
"2022": 94,
"2019": 55,
@@ -66,7 +66,7 @@ ENTRIES = {
"2017": 74,
"2016": 87,
"2015": 80,
- "2014": 67,
+ "2014": 68,
"2013": 52,
"2012": 76,
"2011": 71,
diff --git a/parsers/people.py b/parsers/people.py
index b6b8159..0a05efb 100644
--- a/parsers/people.py
+++ b/parsers/people.py
@@ -137,10 +137,15 @@ def load_people_expos():
nick = ""
rawlastname = personline[header["Lastname"]].strip()
- matchlastname = re.match(r"^([\w&;\s]+)(?:\(([^)]*)\))?", rawlastname)
- lastname = matchlastname.group(1).strip()
+ if rawlastname == "":
+ print(f"MISSING SURNAME FIELD for {name} - check against similar names in the list to see what you have done.")
+ if matchlastname := re.match(r"^([\w&;\s]+)(?:\(([^)]*)\))?", rawlastname):
+ lastname = matchlastname.group(1).strip()
+ else:
+ print(f"MATCH FAIL {personline=}\n {slug=}\n {name=}\n {rawlastname=}")
+ exit(1)
- splitnick = re.match(r"^([\w&;\s]+)(?:\(([^)]*)\))?", plainname)
+ splitnick = re.match(r"^([\w&;\s\-]+)(?:\(([^)]*)\))?", plainname)
fullname = splitnick.group(1) # removes Nickname in brackets, but also cuts hyphenated names
nick = splitnick.group(2) or ""
diff --git a/parsers/survex.py b/parsers/survex.py
index 2a75c8b..b6aa073 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -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):