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

Fixing cave list webpage

This commit is contained in:
Philip Sargent
2021-03-24 00:55:36 +00:00
parent a9fa251fee
commit 7f37327bcd
6 changed files with 19 additions and 7 deletions

View File

@@ -48,7 +48,9 @@ def parseCaveQMs(cave,inputFile):
parse_KH_QMs(kh, inputFile=inputFile)
return
qmPath = settings.EXPOWEB+inputFile
#qmPath = settings.EXPOWEB+inputFile
qmPath = os.path.join(settings.EXPOWEB, inputFile)
qmCSVContents = open(qmPath,'rU')
dialect=csv.Sniffer().sniff(qmCSVContents.read())
qmCSVContents.seek(0,0)
@@ -105,7 +107,7 @@ def parseCaveQMs(cave,inputFile):
def parse_KH_QMs(kh, inputFile):
"""import QMs from the 1623-161 (Kaninchenh<6E>hle) html pages
"""
khQMs=open(settings.EXPOWEB+inputFile,'r')
khQMs=open(os.path.join(settings.EXPOWEB, inputFile),'r')
khQMs=khQMs.readlines()
for line in khQMs:
res=re.search('name=\"[CB](?P<year>\d*)-(?P<cave>\d*)-(?P<number>\d*).*</a> (?P<grade>[ABDCV])<dd>(?P<description>.*)\[(?P<nearest_station>.*)\]',line)

View File

@@ -53,6 +53,7 @@ def readcaves():
raise
print(" - Reading Entrances from entrance descriptions xml files")
print(" - settings.CAVEDESCRIPTIONS: ", settings.CAVEDESCRIPTIONS)
for filename in next(os.walk(settings.ENTRANCEDESCRIPTIONS))[2]: #Should be a better way of getting a list of files
if filename.endswith('.html'):
readentrance(filename)

View File

@@ -4,6 +4,7 @@ import re
import time
import copy
from unipath import Path
from datetime import datetime, timedelta
from subprocess import call, run
@@ -1252,10 +1253,11 @@ def LoadPositions():
print(" - Regenerating stale cavern .log and .3d for '{}'\n days old: {:.1f} {:.1f} {:.1f}".
format(topdata, (svx_t - d3d_t)/(24*3600), (cav_t - d3d_t)/(24*3600), (now - d3d_t)/(24*3600)))
call([settings.CAVERN, "--log", "--output={}".format(topdata), "{}.svx".format(topdata)])
print(" - Regenerating {} {}.3d in {}".format(settings.THREEDTOPOS, topdata, settings.SURVEX_DATA))
call([settings.THREEDTOPOS, '{}.3d'.format(topdata)], cwd = settings.SURVEX_DATA)
print(" - Regenerating {} {}.3d in {}".format(settings.SURVEXPORT, topdata, settings.SURVEX_DATA))
call([settings.SURVEXPORT, '--pos', '{}.3d'.format(topdata)], cwd = settings.SURVEX_DATA)
topdata = settings.SURVEX_DATA + settings.SURVEX_TOPNAME
topdata = settings.SURVEX_DATA.child(settings.SURVEX_TOPNAME)
print((' - Generating a list of Pos from %s.svx and then loading...' % (topdata)))
found = 0