summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/views_survex.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/core/views_survex.py b/core/views_survex.py
index 95bdc70..852dd25 100644
--- a/core/views_survex.py
+++ b/core/views_survex.py
@@ -213,6 +213,11 @@ def err(request, survex_file):
def identifycavedircontents(gcavedir):
# find the primary survex file in each cave directory
+ # name is the directory, nf is the base name of the file we are currently trying
+ # primesvx is the 'controlling' .svx for this dir. This code currently wrongly assumes that every dir has one
+ # The in-scan exceptions are a bad idea.
+ # subsvx is all the svx files in this dir, with 'primesvx' listed first
+ # subdirs is sibdirs of the current dir.
name = os.path.split(gcavedir)[1]
subdirs = [ ]
subsvx = [ ]
@@ -231,7 +236,7 @@ def identifycavedircontents(gcavedir):
elif f[-4:] == ".svx":
nf = f[:-4]
- if nf.lower() == name.lower() or nf[:3] == "all" or (name, nf) in [("resurvey2005", "145-2005"), ("cucc", "cu115")]:
+ if nf.lower() == name.lower() or nf[:3] == "all" or (name, nf) in [("resurvey2005", "145-2005"),("cucc","142"),("cucc","cu115")]:
if primesvx:
if nf[:3] == "all":
assert primesvx[:3] != "all", (name, nf, primesvx, gcavedir, subsvx)
@@ -242,10 +247,15 @@ def identifycavedircontents(gcavedir):
primesvx = nf
else:
subsvx.append(nf)
- else:
- assert re.match(".*?(?:.3d|.log|.err|.txt|.tmp|.diff|.e?spec|~)$", f), (gcavedir, f)
+ #else:
+ # This assert means that having a .ods file in the dir is fatal - that's not a good thing
+ # so commented out [W]
+ #assert re.match(".*?(?:.3d|.log|.err|.txt|.tmp|.diff|.e?spec|~)$", f), (gcavedir, f)
subsvx.sort()
- assert primesvx, (gcavedir, subsvx)
+ #If this code fails then _no_ survey files are vieable.
+ #This assert means that any wierd file someone checks in to the dataset can make _everything_ unveiwable.
+ #If we don't grok it then just skip it.?
+ #assert primesvx, (gcavedir, subsvx)
if primesvx:
subsvx.insert(0, primesvx)
return subdirs, subsvx