Commit 38cfb5e3 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

multiparam close to be ok

parent 86d4b205
......@@ -249,7 +249,7 @@ class AbstractParameter(object):
self.action = MiltipleAction
self.global_help = self.help
self.help = self.global_help + " (" + param_flag + "=<" + param.type.__name__.upper() + ">)"
self.default = {param_flag: param.default}
self.default = {param.name: param.default}
self.nargs = "+"
elif self.type.__class__ == MultipleParameters:
self.type.types[param_flag] = param.type
......@@ -259,7 +259,8 @@ class AbstractParameter(object):
if param.required:
self.type.required.append(param_flag)
self.help = self.global_help + self.type.get_help()
self.default[param_flag] = param.default
self.default[param.name] = param.default
param.flag = param_flag
self.sub_parameters.append(param)
......
......@@ -203,7 +203,16 @@ class Workflow(threading.Thread):
self.__setattr__(param.name, new_param)
elif param.__class__ == ParameterList or param.__class__ == InputFileList:
self.__getattribute__(param.name).extend(args[param.name])
elif param.__class__ == MultiParameter:
sub_args = {}
for sarg in args[param.name]:
sub_args[sarg[0]] = sarg[1]
for sub_param in param.sub_parameters:
if sub_args.has_key(sub_param.flag):
self.__getattribute__(param.name)[sub_param.name] = sub_args[sub_param.flag]
else:
self.__getattribute__(param.name)[sub_param.name] = self.__getattribute__(param.name).default[sub_param.name]
"""
def _get_from_config(self, parameters_section):
reader = ConfigParser()
......
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