diff options
author | Pjotr Prins | 2016-04-20 08:51:57 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-04-20 08:51:57 +0000 |
commit | 1675f34eeff84d7ec0f43c1676f9107e202dda88 (patch) | |
tree | 7640f085774eb774d49b463f54d4251be6ad4d75 /wqflask/utility/tools.py | |
parent | 3be9e4a0950b1ea2d560463032c6f4104baf738e (diff) | |
download | genenetwork2-1675f34eeff84d7ec0f43c1676f9107e202dda88.tar.gz |
[PATCH 027/100] Introduce tools.locate
Diffstat (limited to 'wqflask/utility/tools.py')
-rw-r--r-- | wqflask/utility/tools.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index 5d69e699..624df179 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -78,11 +78,23 @@ def flat_files(subdir=None): return valid_path(base+"/"+subdir) return valid_path(base) +def locate(name, subdir=None): + base = get_setting("GENENETWORK_FILES") + if subdir: + base = base+"/"+subdir + if valid_path(base): + lookfor = base + "/" + name + if valid_path(lookfor): + return lookfor + else: + raise IOError("Can not locate "+lookfor) + raise IOError("Can not locate "+name) + def tempdir(): return valid_path(get_setting("TEMPDIR","/tmp")) + # Cached values - PYLMM_COMMAND = pylmm_command() GEMMA_COMMAND = pylmm_command() PLINK_COMMAND = pylmm_command() |