mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 07:40:19 +00:00
bug fi, always need to regenerate the import .pos file
This commit is contained in:
@@ -149,6 +149,7 @@ def validate_entrance_stations(ent=None):
|
|||||||
elif len(cavelist) > 1:
|
elif len(cavelist) > 1:
|
||||||
cave = cavelist[-1] # set to last in list
|
cave = cavelist[-1] # set to last in list
|
||||||
url = f"/{cave.url}"
|
url = f"/{cave.url}"
|
||||||
|
print(f"WARNING more than one cave '{cavelist}' on Entrance object {ent} ")
|
||||||
else:
|
else:
|
||||||
print(f"BUGGER bad cave '{cavelist}' on Entrance object {ent} ")
|
print(f"BUGGER bad cave '{cavelist}' on Entrance object {ent} ")
|
||||||
url="/caves"
|
url="/caves"
|
||||||
@@ -172,7 +173,7 @@ def validate_entrance_stations(ent=None):
|
|||||||
message =f"{so.count()} found for Entrance {ent} '{ent_type}' station '{st}' {so}"
|
message =f"{so.count()} found for Entrance {ent} '{ent_type}' station '{st}' {so}"
|
||||||
else:
|
else:
|
||||||
# not found
|
# not found
|
||||||
message = f" ! - Entrance {ent} has invalid '{ent_type}' station '{st}'"
|
message = f" ! - Entrance {ent} '{ent_type}' station '{st}' not found as a registered SurvexStation"
|
||||||
if st == ent.best_station():
|
if st == ent.best_station():
|
||||||
message = message + " - AND THIS IS THE 'BEST' ONE"
|
message = message + " - AND THIS IS THE 'BEST' ONE"
|
||||||
else:
|
else:
|
||||||
@@ -289,26 +290,27 @@ def LoadPositions():
|
|||||||
d3dpath = topdata.with_suffix(".3d")
|
d3dpath = topdata.with_suffix(".3d")
|
||||||
pospath = topdata.with_suffix(".pos")
|
pospath = topdata.with_suffix(".pos")
|
||||||
|
|
||||||
if not settings.DEVSERVER:
|
runcavern3d(f"Regen {settings.DEVSERVER=}") # always regenerate .3d and .pos as the *includes may have changed
|
||||||
runcavern3d(f"Regen - on server {settings.DEVSERVER=}") # always regenerate .3d and .pos on the server
|
# if not settings.DEVSERVER:
|
||||||
else:
|
# runcavern3d(f"Regen - on server {settings.DEVSERVER=}") # always regenerate .3d and .pos on the server
|
||||||
# These basic tests fail to capture the case where a *included svx file has changed,
|
# else:
|
||||||
# typically this is one of the fixedpts *fix files.
|
# # These basic tests fail to capture the case where a *included svx file has changed,
|
||||||
for p in [pospath, d3dpath]:
|
# # typically this is one of the fixedpts *fix files.
|
||||||
if not p.is_file():
|
# for p in [pospath, d3dpath]:
|
||||||
runcavern3d(f"Creating {p}.3d, .pos")
|
# if not p.is_file():
|
||||||
svx_t = svxpath.stat().st_mtime
|
# runcavern3d(f"Creating {p}.3d, .pos")
|
||||||
d3d_t = d3dpath.stat().st_mtime # os.path.getmtime(d3dpath)
|
# svx_t = svxpath.stat().st_mtime
|
||||||
svx_d = datetime.fromtimestamp(svx_t).strftime('%d %b %Y %H:%M:%S')
|
# d3d_t = d3dpath.stat().st_mtime # os.path.getmtime(d3dpath)
|
||||||
d3d_d = datetime.fromtimestamp(d3d_t).strftime('%d %b %Y %H:%M:%S')
|
# svx_d = datetime.fromtimestamp(svx_t).strftime('%d %b %Y %H:%M:%S')
|
||||||
|
# d3d_d = datetime.fromtimestamp(d3d_t).strftime('%d %b %Y %H:%M:%S')
|
||||||
|
|
||||||
now = time.time()
|
# now = time.time()
|
||||||
if d3d_t - svx_t < 0: # stale, 3d older than svx file . But .svx timestamp does not reflect *include timestamps
|
# if d3d_t - svx_t < 0: # stale, 3d older than svx file . But .svx timestamp does not reflect *include timestamps
|
||||||
runcavern3d(f"Regen - stale {d3d_d} earlier than {svx_d}")
|
# runcavern3d(f"Regen - stale {d3d_d} earlier than {svx_d}")
|
||||||
elif now - d3d_t > 24 * 60 * 60: # >1 days old, re-run anyway
|
# elif now - d3d_t > 24 * 60 * 60: # >1 days old, re-run anyway
|
||||||
runcavern3d(f"Regen - old")
|
# runcavern3d(f"Regen - old")
|
||||||
elif d3d_t - cav_t < 0: # new version of cavern
|
# elif d3d_t - cav_t < 0: # new version of cavern
|
||||||
runcavern3d(f"Regen - new survex version {d3d_d} earlier than {cav_d} ")
|
# runcavern3d(f"Regen - new survex version {d3d_d} earlier than {cav_d} ")
|
||||||
|
|
||||||
mappoints = {}
|
mappoints = {}
|
||||||
found_points = {}
|
found_points = {}
|
||||||
|
|||||||
@@ -2142,6 +2142,9 @@ class LoadingSurvex:
|
|||||||
def runcavern():
|
def runcavern():
|
||||||
"""regenerates the .3d file from the .svx if it is older than the svx file, or older than the software,
|
"""regenerates the .3d file from the .svx if it is older than the svx file, or older than the software,
|
||||||
or randomly using chaosmonkey() just to keep things ticking over.
|
or randomly using chaosmonkey() just to keep things ticking over.
|
||||||
|
|
||||||
|
This completely fails for e.g. troggle_import_root.svx as the survex file merely includes other files,
|
||||||
|
which may well have changed, e.g. the *fix statements in gps25.svx
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
print(
|
print(
|
||||||
|
|||||||
Reference in New Issue
Block a user