2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-03-13 05:41:47 +00:00

clean up ignore lists for survex files

This commit is contained in:
Philip Sargent 2023-09-25 20:57:25 +03:00
parent 18e1775cff
commit f10db6d73d

View File

@ -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: