summaryrefslogtreecommitdiffstats
path: root/parsers/locations.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-07-08 16:58:27 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2025-07-08 16:58:27 +0300
commit4b4ab973f8378e22358231be8e81e9520014b073 (patch)
treeeba9a16ab5e3d8dc5f312c3bc8f38ced470e099c /parsers/locations.py
parent6c962c0132455bf4bff329856a790d83b935848f (diff)
downloadtroggle-master.tar.gz
troggle-master.tar.bz2
troggle-master.zip
bug fi, always need to regenerate the import .pos fileHEADmaster
Diffstat (limited to 'parsers/locations.py')
-rw-r--r--parsers/locations.py42
1 files changed, 22 insertions, 20 deletions
diff --git a/parsers/locations.py b/parsers/locations.py
index ec0a4ff..2984af2 100644
--- a/parsers/locations.py
+++ b/parsers/locations.py
@@ -149,6 +149,7 @@ def validate_entrance_stations(ent=None):
elif len(cavelist) > 1:
cave = cavelist[-1] # set to last in list
url = f"/{cave.url}"
+ print(f"WARNING more than one cave '{cavelist}' on Entrance object {ent} ")
else:
print(f"BUGGER bad cave '{cavelist}' on Entrance object {ent} ")
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}"
else:
# 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():
message = message + " - AND THIS IS THE 'BEST' ONE"
else:
@@ -289,26 +290,27 @@ def LoadPositions():
d3dpath = topdata.with_suffix(".3d")
pospath = topdata.with_suffix(".pos")
- if not settings.DEVSERVER:
- runcavern3d(f"Regen - on server {settings.DEVSERVER=}") # always regenerate .3d and .pos on the server
- else:
- # These basic tests fail to capture the case where a *included svx file has changed,
- # typically this is one of the fixedpts *fix files.
- for p in [pospath, d3dpath]:
- if not p.is_file():
- runcavern3d(f"Creating {p}.3d, .pos")
- svx_t = svxpath.stat().st_mtime
- d3d_t = d3dpath.stat().st_mtime # os.path.getmtime(d3dpath)
- 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')
+ runcavern3d(f"Regen {settings.DEVSERVER=}") # always regenerate .3d and .pos as the *includes may have changed
+ # if not settings.DEVSERVER:
+ # runcavern3d(f"Regen - on server {settings.DEVSERVER=}") # always regenerate .3d and .pos on the server
+ # else:
+ # # These basic tests fail to capture the case where a *included svx file has changed,
+ # # typically this is one of the fixedpts *fix files.
+ # for p in [pospath, d3dpath]:
+ # if not p.is_file():
+ # runcavern3d(f"Creating {p}.3d, .pos")
+ # svx_t = svxpath.stat().st_mtime
+ # d3d_t = d3dpath.stat().st_mtime # os.path.getmtime(d3dpath)
+ # 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()
- 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}")
- elif now - d3d_t > 24 * 60 * 60: # >1 days old, re-run anyway
- runcavern3d(f"Regen - old")
- elif d3d_t - cav_t < 0: # new version of cavern
- runcavern3d(f"Regen - new survex version {d3d_d} earlier than {cav_d} ")
+ # now = time.time()
+ # 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}")
+ # elif now - d3d_t > 24 * 60 * 60: # >1 days old, re-run anyway
+ # runcavern3d(f"Regen - old")
+ # elif d3d_t - cav_t < 0: # new version of cavern
+ # runcavern3d(f"Regen - new survex version {d3d_d} earlier than {cav_d} ")
mappoints = {}
found_points = {}