diff --git a/core/models_survex.py b/core/models_survex.py index ed581a3..3bae04c 100644 --- a/core/models_survex.py +++ b/core/models_survex.py @@ -97,7 +97,7 @@ class SurvexBlockLookUpManager(models.Manager): blocknames = [] else: blocknames = name.split(".") - block = SurvexBlock.objects.get(parent=None, survexfile__path="all") + block = SurvexBlock.objects.get(parent=None, survexfile__path=settings.SURVEX_TOPNAME) for blockname in blocknames: block = SurvexBlock.objects.get(parent=block, name__iexact=blockname) return block diff --git a/parsers/survex.py b/parsers/survex.py index a999c43..294de73 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -249,7 +249,7 @@ def LoadAllSurvexBlocks(): print(" - Data flushed") - survexfile = models.SurvexFile(path="all", cave=None) + survexfile = models.SurvexFile(path=settings.SURVEX_TOPNAME, cave=None) survexfile.save() survexfile.SetDirectory() @@ -281,9 +281,9 @@ def LoadPos(): print('Loading Pos....') - call([settings.CAVERN, "--output=%s/all.3d" % settings.SURVEX_DATA, "%s/all.svx" % settings.SURVEX_DATA]) - call([settings.THREEDTOPOS, '%sall.3d' % settings.SURVEX_DATA], cwd = settings.SURVEX_DATA) - posfile = open("%sall.pos" % settings.SURVEX_DATA) + call([settings.CAVERN, "--output=%s%s.3d" % (settings.SURVEX_DATA, settings.SURVEX_TOPNAME), "%s%s.svx" % (settings.SURVEX_DATA, settings.SURVEX_TOPNAME)]) + call([settings.THREEDTOPOS, '%s%s.3d' % (settings.SURVEX_DATA, settings.SURVEX_TOPNAME)], cwd = settings.SURVEX_DATA) + posfile = open("%s%s.pos" % (settings.SURVEX_DATA, settings.SURVEX_TOPNAME)) posfile.readline() #Drop header for line in posfile.readlines(): r = poslineregex.match(line) diff --git a/settings.py b/settings.py index 9770fd7..262b28e 100644 --- a/settings.py +++ b/settings.py @@ -53,6 +53,9 @@ SURVEYS_URL = urlparse.urljoin(URL_ROOT , '/survey_scans/') PHOTOS_URL = urlparse.urljoin(URL_ROOT , '/photos/') SVX_URL = urlparse.urljoin(URL_ROOT , '/survex/') +# top-level survex file basename (without .svx) +SURVEX_TOPNAME = "1623" + DEFAULT_LOGBOOK_PARSER = "Parseloghtmltxt" DEFAULT_LOGBOOK_FILE = "logbook.html"