2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00: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,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 })