aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/tools.py
diff options
context:
space:
mode:
authorPjotr Prins2016-10-11 12:11:32 +0000
committerPjotr Prins2016-10-11 12:11:32 +0000
commitf942b4b6c0818010be9b9d245d9e02d2f466f29e (patch)
tree86650fa8fa7836e7d4c39907174dba98a39c59e9 /wqflask/utility/tools.py
parent420fd69ceda63871e9f6755112769c5615ed45f6 (diff)
parentccfe1f2e1afac31de9d1b2f34ad66ed77a517202 (diff)
downloadgenenetwork2-f942b4b6c0818010be9b9d245d9e02d2f466f29e.tar.gz
Merge branch 'testing' into chfi
Diffstat (limited to 'wqflask/utility/tools.py')
-rw-r--r--wqflask/utility/tools.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 23d6fb62..90144962 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -113,6 +113,16 @@ def assert_dir(dir):
raise Exception("ERROR: can not find directory "+dir)
return dir
+def assert_writable_dir(dir):
+ try:
+ fn = dir + "/test.txt"
+ fh = open( fn, 'w' )
+ fh.write("I am writing this text to the file\n")
+ fh.close()
+ os.remove(fn)
+ except IOError:
+ raise Exception('Unable to write test.txt to directory ' + dir )
+ return dir
def mk_dir(dir):
if not valid_path(dir):
@@ -187,6 +197,7 @@ def show_settings():
# Cached values
+GN_VERSION = get_setting('GN_VERSION')
HOME = get_setting('HOME')
WEBSERVER_MODE = get_setting('WEBSERVER_MODE')
GN_SERVER_URL = get_setting('GN_SERVER_URL')
@@ -205,7 +216,7 @@ GENENETWORK_FILES = get_setting('GENENETWORK_FILES')
PYLMM_COMMAND = pylmm_command()
GEMMA_COMMAND = gemma_command()
PLINK_COMMAND = plink_command()
-TEMPDIR = tempdir()
+TEMPDIR = tempdir() # defaults to UNIX TMPDIR
from six import string_types