mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 04:27:11 +00:00
clean up ignore lists for survex files
This commit is contained in:
@@ -47,6 +47,18 @@ ROOTBLOCK = "rootblock"
|
|||||||
METRESINFEET = 3.28084
|
METRESINFEET = 3.28084
|
||||||
UNSEENS = "_unseens.svx"
|
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
|
stop_dup_warning = False
|
||||||
dup_includes = 0
|
dup_includes = 0
|
||||||
debugprint = False # Turns on debug printout for just one *include file
|
debugprint = False # Turns on debug printout for just one *include file
|
||||||
@@ -309,7 +321,6 @@ class LoadingSurvex:
|
|||||||
includestack = []
|
includestack = []
|
||||||
stacksvxfiles = []
|
stacksvxfiles = []
|
||||||
svxfileslist = []
|
svxfileslist = []
|
||||||
#svxdirs = {}
|
|
||||||
svxprim = {}
|
svxprim = {}
|
||||||
uniquefile = {} # each key is a survex path, and its value is a list of parent files
|
uniquefile = {} # each key is a survex path, and its value is a list of parent files
|
||||||
expos = {}
|
expos = {}
|
||||||
@@ -317,16 +328,7 @@ class LoadingSurvex:
|
|||||||
insp = ""
|
insp = ""
|
||||||
callcount = 0
|
callcount = 0
|
||||||
caverncount = 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"
|
TREE = "tree"
|
||||||
ODDS = "oddments"
|
ODDS = "oddments"
|
||||||
svxpass = TREE
|
svxpass = TREE
|
||||||
@@ -1172,6 +1174,7 @@ class LoadingSurvex:
|
|||||||
NOTE self.cavelist is a superset of GCaveLookup, which already contians both uppercase and lowercase aliases
|
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/"
|
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
|
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:
|
for key in self.caveslist:
|
||||||
@@ -1182,9 +1185,10 @@ class LoadingSurvex:
|
|||||||
cave = self.caveslist[key]
|
cave = self.caveslist[key]
|
||||||
print(f"Cave<{cave}> -- {key}")
|
print(f"Cave<{cave}> -- {key}")
|
||||||
|
|
||||||
for i in self.ignoreprefix:
|
for i in IGNOREPREFIX:
|
||||||
if cavepath.lower().startswith(i):
|
if cavepath.lower().startswith(i) or cavepath[11:].lower().startswith(i):
|
||||||
message = (f" - {cavepath} starts with <ignoreprefix> (while creating '{svxid}.svx' )")
|
message = (f" - {cavepath} starts with <IGNOREPREFIX> (while creating '{svxid}.svx' )")
|
||||||
|
# print(message, file=sys.stderr)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if cavepath.lower() in self.caveslist: # primed with GCaveLookup
|
if cavepath.lower() in self.caveslist: # primed with GCaveLookup
|
||||||
@@ -2168,9 +2172,10 @@ def FindAndLoadSurvex():
|
|||||||
file=sys.stderr,
|
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)
|
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()
|
removals = set()
|
||||||
for x in unseens:
|
for x in unseens:
|
||||||
for o in excpts:
|
for o in excpts:
|
||||||
|
|||||||
Reference in New Issue
Block a user