forked from expo/troggle
fixing bad splay detection
This commit is contained in:
@@ -497,9 +497,10 @@ class LoadingSurvex:
|
||||
|
||||
def LoadSurvexAlias(self, survexblock, line):
|
||||
# *alias station - ..
|
||||
splayalias = re.match("(?i)station\s*\-\s*\.\.\s*$", line)
|
||||
splayalias = re.match("(?i)\s*station\s*\-\s*\.\.\s*$", line)
|
||||
if splayalias:
|
||||
self.flagsstar["splayalias"] = True
|
||||
print(line)
|
||||
else:
|
||||
message = f"! Bad *ALIAS: '{line}' ({survexblock}) {survexblock.survexfile.path}"
|
||||
print(self.insp + message)
|
||||
@@ -696,7 +697,13 @@ class LoadingSurvex:
|
||||
survexleg = SurvexLeg()
|
||||
|
||||
# skip all splay legs
|
||||
try:
|
||||
try:
|
||||
if "splayalias" in self.flagsstar:
|
||||
if ls[datastar["from"]] == "-" or ls[datastar["to"]] == "-":
|
||||
if debugprint:
|
||||
print("Aliased splay in ", survexblock.survexfile.path)
|
||||
return
|
||||
|
||||
if ls[datastar["from"]] == ".." or ls[datastar["from"]] == ".":
|
||||
if debugprint:
|
||||
print("Splay in ", survexblock.survexfile.path)
|
||||
@@ -705,15 +712,14 @@ class LoadingSurvex:
|
||||
if debugprint:
|
||||
print("Splay in ", survexblock.survexfile.path)
|
||||
return
|
||||
if self.flagsstar["splayalias"]:
|
||||
if ls[datastar["from"]] == "-":
|
||||
if debugprint:
|
||||
print("Aliased splay in ", survexblock.survexfile.path)
|
||||
return
|
||||
if ls[datastar["to"]] == "-":
|
||||
if debugprint:
|
||||
print("Aliased splay in ", survexblock.survexfile.path)
|
||||
return
|
||||
|
||||
if ls[datastar["to"]] == "-":
|
||||
message = f" ! Suspected splay, not declared, in line {ls} in {survexblock.survexfile.path}"
|
||||
print(self.insp + message)
|
||||
stash_data_issue(
|
||||
parser="survexleg", message=message, url=None, sb=(survexblock.survexfile.path)
|
||||
)
|
||||
return
|
||||
except:
|
||||
message = f" ! datastar parsing from/to incorrect in line {ls} in {survexblock.survexfile.path}"
|
||||
print(self.insp + message)
|
||||
|
||||
Reference in New Issue
Block a user