summaryrefslogtreecommitdiffstats
path: root/core/views_survex.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-03-23 16:36:55 +0000
committerPhilip Sargent <philip.sargent@klebos.com>2021-03-23 16:36:55 +0000
commit4e00645851b380537a6b8e8a8022c87cef740c08 (patch)
treeb9d74e1cb28034c22b53e7d616daffed301eee3a /core/views_survex.py
parent87b30741fc2ce360dd23423769b1562a88fafb0f (diff)
downloadtroggle-4e00645851b380537a6b8e8a8022c87cef740c08.tar.gz
troggle-4e00645851b380537a6b8e8a8022c87cef740c08.tar.bz2
troggle-4e00645851b380537a6b8e8a8022c87cef740c08.zip
fix if empty directory present & display 144, 40
Diffstat (limited to 'core/views_survex.py')
-rw-r--r--core/views_survex.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/views_survex.py b/core/views_survex.py
index 43b9b5b..3b4fe43 100644
--- a/core/views_survex.py
+++ b/core/views_survex.py
@@ -310,8 +310,10 @@ def survexcaveslist(request):
# go through the list and identify the contents of each cave directory
for num, cavedir in fnumlist:
- if cavedir in ["144", "40"]:
- continue
+
+ # these have sub dirs /cucc/ /arge/ /old/ but that is no reason to hide them in this webpage
+ #if cavedir in ["144", "40"]:
+ # continue
gcavedir = os.path.join(cavesdir, cavedir)
if os.path.isdir(gcavedir) and cavedir[0] != ".":
@@ -326,11 +328,12 @@ def survexcaveslist(request):
subsurvdirs = [ ]
for subdir in subdirs:
dsubdirs, dsubsvx = identifycavedircontents(os.path.join(gcavedir, subdir))
- assert not dsubdirs
+ # assert not dsubdirs # handle case of empty sub directory
lsurvdirobj = [ ]
for lsubsvx in dsubsvx:
lsurvdirobj.append(("caves-1623/"+cavedir+"/"+subdir+"/"+lsubsvx, lsubsvx))
- subsurvdirs.append((lsurvdirobj[0], lsurvdirobj[1:]))
+ if len(dsubsvx) > 1:
+ subsurvdirs.append((lsurvdirobj[0], lsurvdirobj[1:]))
subdircaves.append((cavedir, (survdirobj[0], survdirobj[1:]), subsurvdirs))
# multifile caves
@@ -338,7 +341,7 @@ def survexcaveslist(request):
multifilecaves.append((survdirobj[0], survdirobj[1:]))
# single file caves
elif len(survdirobj) == 1:
- onefilecaves.append(survdirobj[0])
+ onefilecaves.append(survdirobj[0])
return render_to_response('svxfilecavelist.html', {'settings': settings, "onefilecaves":onefilecaves, "multifilecaves":multifilecaves, "subdircaves":subdircaves })