From 764136ff18bd355f7b9dbe91f870919b0a17322e Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 24 Jun 2016 06:51:28 +0000 Subject: Log: and document SQL calls --- wqflask/utility/tools.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'wqflask/utility/tools.py') 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): -- cgit v1.2.3