Commit ad1dca7b authored by Jerome Mariette's avatar Jerome Mariette
Browse files

add default initialisation

parent b50a94b0
......@@ -382,7 +382,7 @@ class Parameter(str, AbstractParameter):
def __init__(self, name, help, default="", type=types.StringType, choices=None, required=False,
flag=None, sub_parameters=None, group="default", display_name=None):
AbstractParameter.__init__(self, name, help, flag=flag, type=type, choices=choices, required=required,
AbstractParameter.__init__(self, name, help, flag=flag, default=default, type=type, choices=choices, required=required,
action="store", sub_parameters=sub_parameters, group=group, display_name=display_name)
......@@ -404,7 +404,7 @@ class InputFile(Parameter, AbstractIOFile):
def __init__(self, name, help, file_format="any", default="", type="localfile", choices=None,
required=False, flag=None, group="default", display_name=None):
AbstractIOFile.__init__(self, file_format)
Parameter.__init__(self, name, help, flag=flag, type=type, choices=choices,
Parameter.__init__(self, name, help, flag=flag, default=default, type=type, choices=choices,
required=required, group=group, display_name=display_name)
......@@ -417,7 +417,7 @@ class OutputFile(Parameter, AbstractIOFile):
def __init__(self, name, help, file_format="any", default="", choices=None,
required=False, flag=None, group="default", display_name=None):
AbstractIOFile.__init__(self, file_format)
Parameter.__init__(self, name, help, flag=flag, type="localfile", choices=choices,
Parameter.__init__(self, name, help, flag=flag, default=default, type="localfile", choices=choices,
required=required, group=group, display_name=display_name)
......@@ -426,7 +426,7 @@ class ParameterList(list, AbstractParameter):
def __init__(self, name, help, default=None, type=types.StringType, choices=None, required=False,
flag=None, sub_parameters=None, group="default", display_name=None):
if default == None: default = []
AbstractParameter.__init__(self, name, help, flag=flag, type=type, choices=choices, required=required,
AbstractParameter.__init__(self, name, help, flag=flag, default=default, type=type, choices=choices, required=required,
action="append", sub_parameters=sub_parameters, group=group, display_name=display_name)
if default.__class__.__name__ == "str":
return list.__init__(self, [default])
......@@ -450,7 +450,7 @@ class InputFileList(ParameterList, AbstractIOFile):
+ "', '".join(INPUTFILE_TYPES)+"'")
AbstractIOFile.__init__(self, file_format)
ParameterList.__init__(self, name, help, flag=flag, type=type, choices=choices,
ParameterList.__init__(self, name, help, flag=flag, default=default, type=type, choices=choices,
required=required, group=group, display_name=display_name)
if default.__class__.__name__ == "str":
return list.__init__(self, [default])
......@@ -466,7 +466,7 @@ class OutputFileList(ParameterList, AbstractIOFile):
required=False, flag=None, group="default", display_name=None):
if default == None: default = []
AbstractIOFile.__init__(self, file_format)
ParameterList.__init__(self, name, help, flag=flag, type="localfile", choices=choices,
ParameterList.__init__(self, name, help, flag=flag, default=default, type="localfile", choices=choices,
required=required, group=group, display_name=display_name)
if default.__class__.__name__ == "str":
return list.__init__(self, [default])
......
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