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

Change Parameter to IntParameter, FloatParameter, BoolParameter and...

Change Parameter to IntParameter, FloatParameter, BoolParameter and StrParameter (fix bug with None and with number parameter operators).
parent 3013ebde
This diff is collapsed.
......@@ -157,7 +157,7 @@ class Workflow(threading.Thread):
def add_parameter(self, name, help, default=None, type=types.StringType, choices=None,
required=False, flag=None, group="default", display_name=None, add_to=None):
new_param = Parameter(name, help, flag=flag, default=default, type=type, choices=choices,
new_param = ParameterFactory.factory(name, help, flag=flag, default=default, type=type, choices=choices,
required=required, group=group, display_name=display_name)
# if this input should be added to a particular parameter
if add_to:
......@@ -244,10 +244,10 @@ class Workflow(threading.Thread):
for param in parameters:
try: args[param.name] = args[param.name].encode('ascii','ignore')
except: pass
if param.__class__ == Parameter:
if param.__class__ == StrParameter or param.__class__ == IntParameter or param.__class__ == FloatParameter or param.__class__ == BoolParameter:
if args[param.name]: default = args[param.name]
else: default = param.default
new_param = Parameter(param.name, param.help, default=default, type=param.type, choices=param.choices,
new_param = ParameterFactory.factory(param.name, param.help, default=default, type=param.type, choices=param.choices,
required=param.required, flag=param.flag, group=param.group, display_name=param.display_name)
self.__setattr__(param.name, new_param)
elif param.__class__ == InputFile:
......
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