From 28b19782d2b64dd0f3e0457236f86f8e80e3bb6e Mon Sep 17 00:00:00 2001 From: Guillaume HEUSCH <guillaume.heusch@idiap.ch> Date: Wed, 27 Jun 2018 13:42:29 +0200 Subject: [PATCH] [utils] fixed the function to get parameters --- bob/rppg/base/utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bob/rppg/base/utils.py b/bob/rppg/base/utils.py index 32a8e90..9250c42 100644 --- a/bob/rppg/base/utils.py +++ b/bob/rppg/base/utils.py @@ -145,10 +145,15 @@ def get_parameter(args, configuration, keyword, default): # get the argument in the configuration file if hasattr(configuration, keyword): arg_config = getattr(configuration, keyword) + else: + arg_config = None # get the argument from the command-line - arg_command = _type(args[args_kw]) - + if default is not None: + arg_command = _type(args[args_kw]) + else: + arg_command = default + # if the argument was not specified in the config file if not hasattr(configuration, keyword): return arg_command -- GitLab