aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/tools.py
diff options
context:
space:
mode:
authorzsloan2017-07-06 17:03:59 +0000
committerzsloan2017-07-06 17:03:59 +0000
commit97ee021da1250a63e508461b35188bc875e537e7 (patch)
tree2111574cac4f9408aa6223e10391d2a9a3f15244 /wqflask/utility/tools.py
parent1364fc973518aa13643c3d604a5ccc710bd76e0d (diff)
parentd86f07f616d6892707dd26c87bf70db1a50f070a (diff)
downloadgenenetwork2-97ee021da1250a63e508461b35188bc875e537e7.tar.gz
Merge branch 'testing' of https://github.com/genenetwork/genenetwork2
Diffstat (limited to 'wqflask/utility/tools.py')
-rw-r--r--wqflask/utility/tools.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 393ff2df..867bc5c8 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -108,13 +108,13 @@ def js_path(module=None):
raise "No JS path found for "+module+" (check JS_GN_PATH)"
def pylmm_command(guess=None):
- return valid_bin(get_setting("PYLMM_COMMAND",guess))
+ return assert_bin(get_setting("PYLMM_COMMAND",guess))
def gemma_command(guess=None):
- return valid_bin(get_setting("GEMMA_COMMAND",guess))
+ return assert_bin(get_setting("GEMMA_COMMAND",guess))
def plink_command(guess=None):
- return valid_bin(get_setting("PLINK_COMMAND",guess))
+ return assert_bin(get_setting("PLINK_COMMAND",guess))
def flat_file_exists(subdir):
base = get_setting("GENENETWORK_FILES")
@@ -126,6 +126,11 @@ def flat_files(subdir=None):
return assert_dir(base+"/"+subdir)
return assert_dir(base)
+def assert_bin(fn):
+ if not valid_bin(fn):
+ raise Exception("ERROR: can not find binary "+fn)
+ return fn
+
def assert_dir(dir):
if not valid_path(dir):
raise Exception("ERROR: can not find directory "+dir)
@@ -235,9 +240,9 @@ JS_GUIX_PATH = get_setting('JS_GUIX_PATH')
JS_GN_PATH = get_setting('JS_GN_PATH')
# assert_dir(JS_GN_PATH)
-PYLMM_COMMAND = app_set("PYLMM_COMMAND",pylmm_command())
-GEMMA_COMMAND = app_set("GEMMA_COMMAND",gemma_command())
-PLINK_COMMAND = app_set("PLINK_COMMAND",plink_command())
+PYLMM_COMMAND = pylmm_command()
+GEMMA_COMMAND = gemma_command()
+PLINK_COMMAND = plink_command()
TEMPDIR = tempdir() # defaults to UNIX TMPDIR
# ---- Handle specific JS modules