summaryrefslogtreecommitdiffstats
path: root/parsers/survex.py
diff options
context:
space:
mode:
Diffstat (limited to 'parsers/survex.py')
-rw-r--r--parsers/survex.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index 19b8466..a8eb401 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -3,10 +3,10 @@ import os
import re
import time
import copy
+import subprocess
from pathlib import Path
from datetime import datetime, timedelta
-from subprocess import call, run
from django.utils.timezone import get_current_timezone
from django.utils.timezone import make_aware
@@ -1076,7 +1076,7 @@ class LoadingSurvex():
def runcavern():
print(" - Regenerating stale (or chaos-monkeyed) cavern .log and .3d for '{}'\n days svx old: {:.1f} cav:{:.1f} log old: {:.1f}".
format(fullpath, (svx_t - log_t)/(24*3600), (cav_t - log_t)/(24*3600), (now - log_t)/(24*3600)))
- call([settings.CAVERN, "--log", "--output={}".format(fullpath), "{}.svx".format(fullpath)])
+ subprocess.call([settings.CAVERN, "--log", "--output={}".format(settings.THREEDCACHEDIR), "{}.svx".format(fullpath)])
svxpath = fullpath + ".svx"
logpath = fullpath + ".log"
@@ -1086,7 +1086,7 @@ class LoadingSurvex():
return
if not self.caverndate:
- completed_process = run(["which", "{}".format(settings.CAVERN)],
+ completed_process = subprocess.run(["which", "{}".format(settings.CAVERN)],
capture_output=True, check=True, text=True)
self.caverndate = os.path.getmtime(completed_process.stdout.strip())
cav_t = self.caverndate
@@ -1252,10 +1252,10 @@ def LoadPositions():
def runcavern3d():
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)])
+ subprocess.call([settings.CAVERN, "--log", "--output={}".format(topdata), "{}.svx".format(topdata)])
print(" - Regenerating {} {}.3d in {}".format(settings.SURVEXPORT, topdata, settings.SURVEX_DATA))
- call([settings.SURVEXPORT, '--pos', '{}.3d'.format(topdata)], cwd = settings.SURVEX_DATA)
+ subprocess.call([settings.SURVEXPORT, '--pos', '{}.3d'.format(topdata)], cwd = settings.SURVEX_DATA)
topdata = os.fspath(Path(settings.SURVEX_DATA) / settings.SURVEX_TOPNAME)
print((' - Generating a list of Pos from %s.svx and then loading...' % (topdata)))
@@ -1265,7 +1265,7 @@ def LoadPositions():
print("\n") # extra line because cavern overwrites the text buffer somehow
# cavern defaults to using same cwd as supplied input file
- completed_process = run(["which", "{}".format(settings.CAVERN)],
+ completed_process = subprocess.run(["which", "{}".format(settings.CAVERN)],
capture_output=True, check=True, text=True)
cav_t = os.path.getmtime(completed_process.stdout.strip())