about summary refs log tree commit diff
path: root/wqflask/utility/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/utility/tools.py')
-rw-r--r--wqflask/utility/tools.py14
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()