@@ -311,8 +311,6 @@ class Arguments:
|
|||||||
# (see https://bugs.python.org/issue16399)
|
# (see https://bugs.python.org/issue16399)
|
||||||
# Allow no-config for certain commands (like downloading / plotting)
|
# Allow no-config for certain commands (like downloading / plotting)
|
||||||
if "config" in parsed_arg and parsed_arg.config is None:
|
if "config" in parsed_arg and parsed_arg.config is None:
|
||||||
conf_required = "command" in parsed_arg and parsed_arg.command in NO_CONF_REQURIED
|
|
||||||
|
|
||||||
if "user_data_dir" in parsed_arg and parsed_arg.user_data_dir is not None:
|
if "user_data_dir" in parsed_arg and parsed_arg.user_data_dir is not None:
|
||||||
user_dir = parsed_arg.user_data_dir
|
user_dir = parsed_arg.user_data_dir
|
||||||
else:
|
else:
|
||||||
@@ -325,7 +323,9 @@ class Arguments:
|
|||||||
else:
|
else:
|
||||||
# Else use "config.json".
|
# Else use "config.json".
|
||||||
cfgfile = Path.cwd() / DEFAULT_CONFIG
|
cfgfile = Path.cwd() / DEFAULT_CONFIG
|
||||||
if cfgfile.is_file() or not conf_required:
|
conf_optional = "command" in parsed_arg and parsed_arg.command in NO_CONF_REQURIED
|
||||||
|
if cfgfile.is_file() or not conf_optional:
|
||||||
|
# Only inject config if the file exists, or if the config is optional
|
||||||
parsed_arg.config = [DEFAULT_CONFIG]
|
parsed_arg.config = [DEFAULT_CONFIG]
|
||||||
|
|
||||||
return parsed_arg
|
return parsed_arg
|
||||||
|
|||||||
Reference in New Issue
Block a user