2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 12:27:05 +00:00

Big refactor of cave lookuo & creation. Works.

This commit is contained in:
2023-09-08 19:51:04 +03:00
parent 7779544c0c
commit 5a191ee554
4 changed files with 33 additions and 22 deletions

View File

@@ -133,6 +133,7 @@ def get_area(areanum):
def create_new_cave(svxpath):
"""This is called only when a new survex file is edited online which has a path on the
:loser: repo which is not recognised as a known cave.
ALSO called by survex parser when it finds a cave it doesn't recognise
"""
# e.g. svxpath = "caves-1623/666/antig"
print(f"Create new cave at {svxpath}")
@@ -171,7 +172,8 @@ def create_new_cave(svxpath):
print(message)
raise
# we know what the survex file is, we don't need to use the guess
# we know what the survex file is, we don't need to use the guess.
# But this sets the survex file on he cave from the first one we find, not necessarily the best survex file for this cave
cave.survex_file=survex_file
cave.save()
return cave