summaryrefslogtreecommitdiffstats
path: root/parsers
diff options
context:
space:
mode:
Diffstat (limited to 'parsers')
-rw-r--r--parsers/survex.py37
1 files changed, 21 insertions, 16 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index 679ed53..0292452 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -47,6 +47,18 @@ ROOTBLOCK = "rootblock"
METRESINFEET = 3.28084
UNSEENS = "_unseens.svx"
+IGNOREPREFIX = ["surface", "kataster", "fixedpts", "gpx", "deprecated", "dummy_"]
+EXCEPTPREFIX = ["surface/terrain", "kataster/kataster-boundaries", "gpx/gpx_publish/essentials", "template", "docs", "deprecated", "subsections", "1623-and-1626-no-schoenberg-hs", "1623-and-1624-and-1626-and-1627", "1623-and-1626", "dummy_file"]
+# ignorenoncave = [
+ # "caves-1623",
+ # "caves-1623/2007-NEU",
+ # "caves-1626",
+ # "caves-1624",
+ # "caves-1627",
+ # "fixedpts/gps/gps00raw",
+ # "",
+# ]
+
stop_dup_warning = False
dup_includes = 0
debugprint = False # Turns on debug printout for just one *include file
@@ -309,7 +321,6 @@ class LoadingSurvex:
includestack = []
stacksvxfiles = []
svxfileslist = []
- #svxdirs = {}
svxprim = {}
uniquefile = {} # each key is a survex path, and its value is a list of parent files
expos = {}
@@ -317,16 +328,7 @@ class LoadingSurvex:
insp = ""
callcount = 0
caverncount = 0
- ignoreprefix = ["surface", "kataster", "fixedpts", "gpx", "deprecated", "dummy_"]
- # ignorenoncave = [
- # "caves-1623",
- # "caves-1623/2007-NEU",
- # "caves-1626",
- # "caves-1624",
- # "caves-1627",
- # "fixedpts/gps/gps00raw",
- # "",
- # ]
+
TREE = "tree"
ODDS = "oddments"
svxpass = TREE
@@ -1172,6 +1174,7 @@ class LoadingSurvex:
NOTE self.cavelist is a superset of GCaveLookup, which already contians both uppercase and lowercase aliases
why is this called with cavepath="caves-1623/2023-kt-02" when this is a cave where the files are in "caves-1623/2023-kt-02/"
+ cavepath = 'surface/1623' when svxis is 'surface/1623/2004-18to298.svx'
"""
if cavepath == "caves-1623/99ob02": # nothing special about this cave, just used as a marker to dump the cavelist to file
for key in self.caveslist:
@@ -1182,9 +1185,10 @@ class LoadingSurvex:
cave = self.caveslist[key]
print(f"Cave<{cave}> -- {key}")
- for i in self.ignoreprefix:
- if cavepath.lower().startswith(i):
- message = (f" - {cavepath} starts with <ignoreprefix> (while creating '{svxid}.svx' )")
+ for i in IGNOREPREFIX:
+ if cavepath.lower().startswith(i) or cavepath[11:].lower().startswith(i):
+ message = (f" - {cavepath} starts with <IGNOREPREFIX> (while creating '{svxid}.svx' )")
+ # print(message, file=sys.stderr)
return False
if cavepath.lower() in self.caveslist: # primed with GCaveLookup
@@ -2168,9 +2172,10 @@ def FindAndLoadSurvex():
file=sys.stderr,
)
- # These exceptions WILL be parsed if the are *included by any file which is not excepted
+ # These exceptions WILL nevertheless be parsed if the are *included by any file which is not excepted
unseensroot = re.sub(r"\.svx$", "", UNSEENS)
- excpts = ["surface/terrain", "kataster/kataster-boundaries", "gpx/gpx_publish/essentials", "template", "docs", "deprecated", "subsections", "1623-and-1626-no-schoenberg-hs", "1623-and-1624-and-1626-and-1627", "1623-and-1626", "dummy_file", unseensroot]
+ excpts = EXCEPTPREFIX
+ excpts.append(unseensroot)
removals = set()
for x in unseens:
for o in excpts: