2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-04-04 09:51:47 +01:00

fix if empty directory present & display 144, 40

This commit is contained in:
Philip Sargent 2021-03-23 16:36:55 +00:00
parent 87b30741fc
commit 4e00645851

View File

@ -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,10 +328,11 @@ 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))
if len(dsubsvx) > 1:
subsurvdirs.append((lsurvdirobj[0], lsurvdirobj[1:]))
subdircaves.append((cavedir, (survdirobj[0], survdirobj[1:]), subsurvdirs))