From 1675f34eeff84d7ec0f43c1676f9107e202dda88 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 20 Apr 2016 08:51:57 +0000 Subject: [PATCH 027/100] Introduce tools.locate --- wqflask/utility/tools.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'wqflask/utility') 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() -- cgit v1.2.3