summaryrefslogtreecommitdiffstats
path: root/parsers/survex.py
diff options
context:
space:
mode:
Diffstat (limited to 'parsers/survex.py')
-rw-r--r--parsers/survex.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index e1633ce..a86399f 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -2481,6 +2481,17 @@ def MakeFileRoot(svxpath):
return fileroot
+def caveifywallets():
+ """Gets the caves from the list of survexblocks
+ """
+ wallets = Wallet.objects.all()
+ for w in wallets:
+ blocks = SurvexBlock.objects.filter(scanswallet=w)
+ for b in blocks:
+ # NB b.cave is not populated by parser. Use b.survexfile.cave instead, or we could parse b.survexpath
+ if b.survexfile.cave:
+ w.caves.add(b.survexfile.cave)
+
def LoadSurvexBlocks():
global dup_includes
@@ -2536,4 +2547,6 @@ def LoadSurvexBlocks():
if dup_includes > 0:
print(f" - ERROR: There are {dup_includes} duplicate *includes in the final list")
print(" - Loaded All Survex Blocks.")
+
+