2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 14:57:13 +00:00

working on rebuilding everything

This commit is contained in:
Rad
2019-02-27 22:29:45 +00:00
parent 7e1aa80551
commit ce268ec306
13 changed files with 2435 additions and 879 deletions

View File

@@ -40,6 +40,62 @@ survextemplatefile = """; Locn: Totes Gebirge, Austria - Loser/Augst-Eck Plateau
*end [surveyname]"""
def millenialcaves(request):
cavesdir = os.path.join(settings.SURVEX_DATA, "caves-1623")
#cavesdircontents = { }
onefilecaves = [ ]
multifilecaves = [ ]
subdircaves = [ ]
millenialcaves = [ ]
# go through the list and identify the contents of each cave directory
for cavedir in os.listdir(cavesdir):
if cavedir in ["144", "40"]: #????? RW
continue
gcavedir = os.path.join(cavesdir, cavedir) #directory od 'large' cave
if os.path.isdir(gcavedir) and cavedir[0] != ".":
subdirs, subsvx = identifycavedircontents(gcavedir)
survdirobj = [ ]
for lsubsvx in subsvx:
survdirobj.append(("caves-1623/"+cavedir+"/"+lsubsvx, lsubsvx))
# caves with subdirectories
if subdirs:
subsurvdirs = [ ]
for subdir in subdirs:
dsubdirs, dsubsvx = identifycavedircontents(os.path.join(gcavedir, subdir))
assert not dsubdirs
lsurvdirobj = [ ]
for lsubsvx in dsubsvx:
lsurvdirobj.append(("caves-1623/"+cavedir+"/"+subdir+"/"+lsubsvx, lsubsvx))
subsurvdirs.append((lsurvdirobj[0], lsurvdirobj[1:]))
subdircaves.append((cavedir, (survdirobj[0], survdirobj[1:]), subsurvdirs))
# multifile caves
elif len(survdirobj) > 1:
multifilecaves.append((survdirobj[0], survdirobj[1:]))
# single file caves
else:
#print("survdirobj = ")
#print(survdirobj)
onefilecaves.append(survdirobj[0])
caves = Cave.objects.all()
return render_to_response('millenialcaves.html', {'settings': settings , 'caves':caves , "onefilecaves":onefilecaves, "multifilecaves":multifilecaves, "subdircaves":subdircaves })
def ReplaceTabs(stext):
res = [ ]