diff --git a/README.txt b/README.txt index d62667e..d9f95ea 100644 --- a/README.txt +++ b/README.txt @@ -23,7 +23,7 @@ Setting up directories - create a directory in which you also have the loser/, expoweb/ and drawings/ repositories - git clone (see below) the current latest troggle from the 'python3' git branch into a folder called 'troggle' -- all the 4 repos should now be siblings, and also siblings with expofiles/ +- all the 4 repos should now be siblings, and also siblings with expofiles/ and expowebcache/ - if you have those repos elsewhere, set up symlinks in the directory above troggle so that troggle thinks they are siblings @@ -157,6 +157,12 @@ which will give security warnings for deployment. python manage.py check -Wall Gives warnings of deprecated Django which should be fixed asap. +python manage.py test core +Runs our test suite + +python manage.py test +Runs tests for all the django plugins ("apps") + Registering troggle as a django application ------------------------------------------- In your troggle directory run 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\d*)-(?P\d*)-(?P\d*).* (?P[ABDCV])
(?P.*)\[(?P.*)\]',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 diff --git a/requirements.txt b/requirements.txt index 92e6601..7438472 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ docutils==0.16 Pillow==7.2.0 pytz==2020.1 Unidecode==1.1.1 +Unipath==1.1 diff --git a/templates/svxcavesingle.html b/templates/svxcavesingle.html index ca9ba58..bf505dd 100644 --- a/templates/svxcavesingle.html +++ b/templates/svxcavesingle.html @@ -6,7 +6,7 @@ {% block content %} -

Surveys for {{cave}}

+

Surveys for cave - kataster number:{{cave}}

{% for survexdirectory in cave.survexdirectory_set.all %}