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

No commit message

No commit message
parent 800c2bd6
...@@ -225,11 +225,11 @@ class Workflow(threading.Thread): ...@@ -225,11 +225,11 @@ class Workflow(threading.Thread):
attribute_value.type.excludes[new_group] = flags2exclude attribute_value.type.excludes[new_group] = flags2exclude
break break
def _prepare_parameter(self, args, parameter): def _prepare_parameter(self, args, parameter, key="name"):
new_param = None new_param = None
# Retrieve value # Retrieve value
if args.has_key(parameter.flag): if args.has_key(parameter.__getattribute__(key)):
value = args[parameter.flag] value = args[parameter.__getattribute__(key)]
elif parameter != None: elif parameter != None:
value = parameter.default value = parameter.default
else: else:
...@@ -268,7 +268,7 @@ class Workflow(threading.Thread): ...@@ -268,7 +268,7 @@ class Workflow(threading.Thread):
for sarg in args[param.name]: for sarg in args[param.name]:
sub_args[sarg[0]] = sarg[1] sub_args[sarg[0]] = sarg[1]
for sub_param in param.sub_parameters: for sub_param in param.sub_parameters:
new_sub_parameter = self._prepare_parameter(sub_args, sub_param) new_sub_parameter = self._prepare_parameter(sub_args, sub_param, "flag")
new_param[new_sub_parameter.name] = new_sub_parameter 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)
...@@ -279,7 +279,7 @@ class Workflow(threading.Thread): ...@@ -279,7 +279,7 @@ class Workflow(threading.Thread):
for sarg in sargs: for sarg in sargs:
sub_args[sarg[0]] = sarg[1] sub_args[sarg[0]] = sarg[1]
for sub_param in param.sub_parameters: for sub_param in param.sub_parameters:
new_sub_param = self._prepare_parameter(sub_args, sub_param) new_sub_param = self._prepare_parameter(sub_args, sub_param, "flag")
new_multi_param[new_sub_param.name] = new_sub_param new_multi_param[new_sub_param.name] = new_sub_param
new_param.append(new_multi_param) new_param.append(new_multi_param)
else: else:
......
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