diff options
author | Pjotr Prins | 2016-10-07 07:05:22 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-10-07 07:05:22 +0000 |
commit | 9e4c8f01e1a0aa49d218f7909ed5b7979ffc6fb9 (patch) | |
tree | 7033440d3325b180c692a692d22d7afee4c6c47a /wqflask/base | |
parent | 28da8f4304f406b4eff5ad68757735a0cb524e94 (diff) | |
download | genenetwork2-9e4c8f01e1a0aa49d218f7909ed5b7979ffc6fb9.tar.gz |
Saner handling of TMPDIR and TEMPDIR
Throw error when TMPDIRs are not writable
Diffstat (limited to 'wqflask/base')
-rw-r--r-- | wqflask/base/webqtlConfig.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/wqflask/base/webqtlConfig.py b/wqflask/base/webqtlConfig.py index 6bbabdec..e5f10edf 100644 --- a/wqflask/base/webqtlConfig.py +++ b/wqflask/base/webqtlConfig.py @@ -8,7 +8,7 @@ # ######################################### -from utility.tools import valid_path, mk_dir, assert_dir, flat_files, TEMPDIR +from utility.tools import valid_path, mk_dir, assert_dir, assert_writable_dir, flat_files, TEMPDIR #Debug Level #1 for debug, mod python will reload import each time @@ -60,24 +60,36 @@ ENSEMBLETRANSCRIPT_URL="http://useast.ensembl.org/Mus_musculus/Lucene/Details?sp # HTMLPATH is replaced by GENODIR # IMGDIR is replaced by GENERATED_IMAGE_DIR -# Temporary storage (note that this TMPDIR is not the same directory -# as the UNIX TMPDIR) +# Temporary storage (note that this TMPDIR can be set as an +# environment variable - use utility.tools.TEMPDIR when you +# want to reach this base dir +assert_writable_dir(TEMPDIR) + TMPDIR = mk_dir(TEMPDIR+'/gn2/') +assert_writable_dir(TMPDIR) + CACHEDIR = mk_dir(TMPDIR+'/cache/') # We can no longer write into the git tree: GENERATED_IMAGE_DIR = mk_dir(TMPDIR+'/generated/') GENERATED_TEXT_DIR = mk_dir(TMPDIR+'/generated_text/') +# Make sure we have permissions to access these +assert_writable_dir(CACHEDIR) +assert_writable_dir(GENERATED_IMAGE_DIR) +assert_writable_dir(GENERATED_TEXT_DIR) + # Flat file directories GENODIR = flat_files('genotype')+'/' +assert_dir(GENODIR) + +# JSON genotypes are OBSOLETE JSON_GENODIR = flat_files('genotype/json')+'/' if not valid_path(JSON_GENODIR): # fall back on old location (move the dir, FIXME) JSON_GENODIR = flat_files('json') -assert_dir(GENODIR) +# Are we using the following...? PORTADDR = "http://50.16.251.170" - INFOPAGEHREF = '/dbdoc/%s.html' CGIDIR = '/webqtl/' #XZ: The variable name 'CGIDIR' should be changed to 'PYTHONDIR' SCRIPTFILE = 'main.py' |