summaryrefslogtreecommitdiffstats
path: root/parsers/survex.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-10-04 00:00:55 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-10-04 00:00:55 +0300
commita6e60c0bf7ac09175b556cabb8dd13d0d2d49a12 (patch)
treec9d1c3f85e48a8b7a3d2f07bdad00c9f237b5c42 /parsers/survex.py
parentc8163ab0cd08682eae783544b69f31755b85857f (diff)
downloadtroggle-a6e60c0bf7ac09175b556cabb8dd13d0d2d49a12.tar.gz
troggle-a6e60c0bf7ac09175b556cabb8dd13d0d2d49a12.tar.bz2
troggle-a6e60c0bf7ac09175b556cabb8dd13d0d2d49a12.zip
working on loading all the non*inlcuded svx files
Diffstat (limited to 'parsers/survex.py')
-rw-r--r--parsers/survex.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index 70afddf..d37fea7 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -1201,6 +1201,7 @@ class LoadingSurvex():
print("\n ", file=sys.stderr,end='')
if path in self.svxfileslist:
+ # We have already used os.normpath() so this is OK. "/../" and "//" have been simplified already.
message = f" * Warning. Duplicate detected. We have already seen this *include '{path}' from another survex file. Detected at callcount:{self.callcount} depth:{self.depthinclude}"
print(message)
print(message,file=flinear)
@@ -1464,14 +1465,36 @@ def FindAndLoadSurvex(survexblockroot):
flinear.write(" - {:,} survex files in linear include list \n".format(len(svxfileslist)))
flinear.close()
fcollate.close()
+
print("\n - {:,} runs of survex 'cavern' refreshing .3d files \n".format(svx_scan.caverncount),file=sys.stderr)
+
svx_scan = None # Hmm. Does this actually delete all the instance variables if they are lists, dicts etc.?
print("\n - {:,} survex files in linear include list \n".format(len(svxfileslist)),file=sys.stderr)
-
-
+
mem1 = get_process_memory()
print(" - MEM:{:7.2f} MB END ".format(mem0),file=sys.stderr)
print(" - MEM:{:7.3f} MB USED".format(mem1-mem0),file=sys.stderr)
+
+ a = []
+ b=[]
+
+ for p in Path(settings.SURVEX_DATA).rglob('*.svx'):
+ if p.is_file():
+ po = p.relative_to(Path(settings.SURVEX_DATA))
+ pox = po.with_suffix('')
+ if str(pox) not in svxfileslist:
+ print(f"[{pox}]", file=sys.stderr)
+ a.append(pox)
+ else:
+ print("'", end=" ", file=sys.stderr)
+ b.append(pox)
+
+ print("=>", len(a), len(b), len(svxfileslist), file=sys.stderr)
+
+ for i in [0,1,2,3,4,5]:
+ print(f"==> [{svxfileslist[i]}]", file=sys.stderr)
+
+
svxfileslist = [] # free memory
# Before doing this, it would be good to identify the *equate and *entrance we need that are relevant to the