2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

better error msg

This commit is contained in:
Philip Sargent 2022-07-09 01:54:48 +03:00
parent 8d31ab763d
commit 278a84a485

View File

@ -36,6 +36,8 @@ todo = '''Also walk the entire tree in the :loser: repo looking for unconnected
- LoadSurvexFile() Creates a new current survexfile and valid .survexdirectory
The survexblock passed-in is not necessarily the parent. FIX THIS.
- rx_qm recognises only simple survey point ids. EXTEND to cover more naming formats and test fully for 2023
'''
survexblockroot = None
ROOTBLOCK = "rootblock"
@ -118,6 +120,7 @@ class LoadingSurvex():
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+(.+)$')
# does not recognise non numeric suffix survey point ids
rx_qm0 = re.compile(r'(?i)^\s*QM(\d)\s+(.+)$')
# remember there is also QM_PATTERN used in views.other and set in settings.py
rx_tapelng = re.compile(r'(?i).*(tape|length).*$')
@ -807,6 +810,8 @@ class LoadingSurvex():
# ignore all comments except ;ref, ; wallet and ;QM and ;*include (for collated survex file)
# rx_ref2 = re.compile(r'(?i)\s*ref[.;]?')
# rx_ref3 = re.compile(r'(?i)\s*wallet[.;]?')
# This should also check that the QM survey point rxists in the block
refline = self.rx_commref.match(comment)
if refline:
@ -828,7 +833,7 @@ class LoadingSurvex():
if qmline:
self.LoadSurvexQM(survexblock, qmline)
else:
message = f' ! QM Unrecognised as a valid QM in "{survexblock.survexfile.path}" {qml}'
message = f' ! QM Unrecognised as a valid QM in "{survexblock.survexfile.path}" QM{qml.group(1)} {qml.group(2)}'
print(message)
DataIssue.objects.create(parser='survex', message=message)