summaryrefslogtreecommitdiffstats
path: root/parsers
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-03-24 00:55:36 +0000
committerPhilip Sargent <philip.sargent@klebos.com>2021-03-24 00:55:36 +0000
commit7f37327bcdb3d6588a5ca189f7f0ecfba3f95ffa (patch)
treeeb73a383f6b98a25f092395fbdb29d6099892248 /parsers
parenta9fa251fee2f71ef943af7054eaf2b62abe4ea8b (diff)
downloadtroggle-7f37327bcdb3d6588a5ca189f7f0ecfba3f95ffa.tar.gz
troggle-7f37327bcdb3d6588a5ca189f7f0ecfba3f95ffa.tar.bz2
troggle-7f37327bcdb3d6588a5ca189f7f0ecfba3f95ffa.zip
Fixing cave list webpage
Diffstat (limited to 'parsers')
-rw-r--r--parsers/QMs.py6
-rw-r--r--parsers/caves.py1
-rw-r--r--parsers/survex.py8
3 files changed, 10 insertions, 5 deletions
diff --git a/parsers/QMs.py b/parsers/QMs.py
index 89a2640..a95a3cd 100644
--- a/parsers/QMs.py
+++ b/parsers/QMs.py
@@ -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�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)
diff --git a/parsers/caves.py b/parsers/caves.py
index 4a058fd..e66b46a 100644
--- a/parsers/caves.py
+++ b/parsers/caves.py
@@ -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)
diff --git a/parsers/survex.py b/parsers/survex.py
index ff2e646..2ca2f1d 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -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