diff options
author | Pjotr Prins | 2016-06-24 06:51:28 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-06-24 06:51:28 +0000 |
commit | 764136ff18bd355f7b9dbe91f870919b0a17322e (patch) | |
tree | 2636b5c0d68d38e391476b4723a6f005d536b5c8 /wqflask/utility/tools.py | |
parent | 923e94c39f5768f836dbf5fc29b0186c13ccc86b (diff) | |
download | genenetwork2-764136ff18bd355f7b9dbe91f870919b0a17322e.tar.gz |
Log: and document SQL calls
Diffstat (limited to 'wqflask/utility/tools.py')
-rw-r--r-- | wqflask/utility/tools.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py index 93b1fa51..bb8241f5 100644 --- a/wqflask/utility/tools.py +++ b/wqflask/utility/tools.py @@ -43,12 +43,13 @@ def get_setting(command_id,guess=None): # ---- Check whether environment exists logger.debug("Looking for "+command_id+"\n") command = value(os.environ.get(command_id)) - if command == None or command == "": + if command is None or command == "": # ---- Check whether setting exists in app command = value(app.config.get(command_id)) - if command == None: + if command is None: command = value(guess) - if command == None or command == "": + if command is None or command == "": + print command raise Exception(command_id+' setting unknown or faulty (update default_settings.py?).') logger.debug("Set "+command_id+"="+str(command)) return command @@ -61,7 +62,11 @@ def get_setting_bool(id): def get_setting_int(id): v = get_setting(id) - return int(v) + if isinstance(v, str): + return int(v) + if v is None: + return 0 + return v def valid_bin(bin): if os.path.islink(bin) or valid_file(bin): |