aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/utility/tools.py')
-rw-r--r--wqflask/utility/tools.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 0f2e4d88..c0f6a49a 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -79,6 +79,15 @@ def flat_files(subdir=None):
return valid_path(base+"/"+subdir)
return valid_path(base)
+def assert_dir(dir):
+ if not valid_path(dir):
+ raise Exception("ERROR: can not find directory "+dir)
+ return dir
+
+def mk_dir(dir):
+ os.makedirs(dir)
+ return assert_dir(dir)
+
def locate(name, subdir=None):
"""
Locate a static flat file in the GENENETWORK_FILES environment.
@@ -98,7 +107,7 @@ def locate(name, subdir=None):
if subdir: sys.stderr.write(subdir)
raise IOError("Can not locate "+name+" in "+base)
-def locate_without_error(name, subdir=None):
+def locate_ignore_error(name, subdir=None):
"""
Locate a static flat file in the GENENETWORK_FILES environment.