From 90dfa516da857f300bd0ff483ebf7a412934bbcf Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 9 Jul 2020 18:06:03 +0100 Subject: [PATCH] *team format updates --- parsers/survex.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/parsers/survex.py b/parsers/survex.py index 2b2a20c..f058583 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -56,7 +56,8 @@ class LoadingSurvex(): rx_names = re.compile(r'(?i)names') rx_flagsnot= re.compile(r"not\s") rx_linelen = re.compile(r"[\d\-+.]+$") - rx_teammem = re.compile(r"(?i)(Insts|Notes|Tape|Dog|Useless|Pics|Helper|Disto|Consultant)\s+(.*)$") + instruments = "(waiting_patiently|slacker|Useless|nagging|unknown|Inst|instrument|rig|rigger|rigging|helper|something| compass|comp|clino|Notes|sketch|book|Tape|Dog|Pics|photo|drawing|Helper|GPS|Disto|Distox|Distox2|topodroid|point|Consultant|nail|polish|varnish|bitch|monkey)" + rx_teammem = re.compile(r"(?i)"+instruments+"?(?:es|s)?\s+(.*)"+instruments+"?(?:es|s)?$") rx_person = re.compile(r"(?i) and | / |, | & | \+ |^both$|^none$") rx_qm = re.compile(r'(?i)^\s*QM(\d)\s+?([a-dA-DxX])\s+([\w\-]+)\.(\d+)\s+(([\w\-]+)\.(\d+)|\-)\s+(.+)$') # remember there is also QM_PATTERN used in views_other and set in settings.py @@ -134,6 +135,16 @@ class LoadingSurvex(): models.DataIssue.objects.create(parser='survex', message=message) def LoadSurvexTeam(self, survexblock, line): + """Interpeting the *team fields means interpreting older style survex as well as current survex standard, + *team Insts Anthony Day - this is how most of our files specify the team member + *team "Anthony Day" notes pictures tape - this is how the survex documentation says it should be done + We have a huge variety of abbreviations and mispellings. The most laconic being + *team gb, bl + If you look at e.g. http://expo.survex.com/survexfile/161#T_caves-1623/161/lhr/alllhr + you will see than have the team members are recognised by this parser, but not recognised by the + wider troggle system (the name is not a hyperlink) - apparently randomly. + GetPersonExpeditionNameLookup() needs to be fixed. + """ teammembers = [ ] mteammember = self.rx_teammem.match(line) if mteammember: