Commit b9cf2715 authored by Frédéric Escudié's avatar Frédéric Escudié
Browse files

Return empty dict for MultiParameter without args.

parent 6ccfba06
...@@ -235,6 +235,7 @@ class Workflow(threading.Thread): ...@@ -235,6 +235,7 @@ class Workflow(threading.Thread):
value = None value = None
# Set new parameter # Set new parameter
if parameter.__class__ == StrParameter or parameter.__class__ == IntParameter or parameter.__class__ == FloatParameter or parameter.__class__ == BoolParameter or parameter.__class__ == DateParameter: if parameter.__class__ == StrParameter or parameter.__class__ == IntParameter or parameter.__class__ == FloatParameter or parameter.__class__ == BoolParameter or parameter.__class__ == DateParameter:
if value == "" : value = None # from GUI
new_param = ParameterFactory.factory( parameter.name, parameter.help, default=value, type=parameter.type, choices=parameter.choices, new_param = ParameterFactory.factory( parameter.name, parameter.help, default=value, type=parameter.type, choices=parameter.choices,
required=parameter.required, flag=parameter.flag, group=parameter.group, required=parameter.required, flag=parameter.flag, group=parameter.group,
display_name=parameter.display_name ) display_name=parameter.display_name )
...@@ -250,7 +251,7 @@ class Workflow(threading.Thread): ...@@ -250,7 +251,7 @@ class Workflow(threading.Thread):
group=parameter.group, display_name=parameter.display_name, size_limit=parameter.size_limit ) group=parameter.group, display_name=parameter.display_name, size_limit=parameter.size_limit )
elif parameter.__class__ == InputFile: elif parameter.__class__ == InputFile:
if value == "" : value = None # from GUI if value == "" : value = None # from GUI
new_param = InputFile( parameter.name, parameter.help, file_format=parameter.file_format, default=parameter.prepare_input_file(value), new_param = InputFile( parameter.name, parameter.help, file_format=parameter.file_format, default=parameter.prepare_input_file(value),
type=parameter.type, choices=parameter.choices, required=parameter.required, flag=parameter.flag, type=parameter.type, choices=parameter.choices, required=parameter.required, flag=parameter.flag,
group=parameter.group, display_name=parameter.display_name ) group=parameter.group, display_name=parameter.display_name )
else: else:
...@@ -266,12 +267,13 @@ class Workflow(threading.Thread): ...@@ -266,12 +267,13 @@ class Workflow(threading.Thread):
if param.__class__ == MultiParameter: if param.__class__ == MultiParameter:
new_param = MultiParameter(param.name, param.help, required=param.required, flag=param.flag, group=param.group, display_name=param.display_name) new_param = MultiParameter(param.name, param.help, required=param.required, flag=param.flag, group=param.group, display_name=param.display_name)
new_param.sub_parameters = param.sub_parameters new_param.sub_parameters = param.sub_parameters
sub_args = {} if args[param.name]:
for sarg in args[param.name]: sub_args = {}
sub_args[sarg[0]] = sarg[1] for sarg in args[param.name]:
for sub_param in param.sub_parameters: sub_args[sarg[0]] = sarg[1]
new_sub_parameter = self._prepare_parameter(sub_args, sub_param, "flag") for sub_param in param.sub_parameters:
new_param[new_sub_parameter.name] = new_sub_parameter new_sub_parameter = self._prepare_parameter(sub_args, sub_param, "flag")
new_param[new_sub_parameter.name] = new_sub_parameter
elif param.__class__ == MultiParameterList: elif param.__class__ == MultiParameterList:
new_param = MultiParameterList(param.name, param.help, required=param.required, flag=param.flag, group=param.group, display_name=param.display_name) new_param = MultiParameterList(param.name, param.help, required=param.required, flag=param.flag, group=param.group, display_name=param.display_name)
new_param.sub_parameters = param.sub_parameters new_param.sub_parameters = param.sub_parameters
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment