2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-14 18:37:18 +00:00

caves->wallets at parse time

This commit is contained in:
2023-10-23 03:24:34 +03:00
parent 54ffab3e93
commit 2b96086535
4 changed files with 21 additions and 60 deletions

View File

@@ -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.")