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

Add AbstractInputFile.

parent 0f71688d
......@@ -404,8 +404,19 @@ class Parameter(str, AbstractParameter):
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)
class AbstractInputFile(AbstractIOFile):
"""
@summary : Parent of all InputFile(s) parameters.
"""
pass
class AbstractOutputFile(AbstractIOFile):
"""
@summary : Parent of all OutputFile(s) parameters.
"""
pass
class InputFile(Parameter, AbstractIOFile):
class InputFile(Parameter, AbstractInputFile):
def __new__(self, name, help, file_format="any", default="", type="localfile", choices=None,
required=False, flag=None, group="default", display_name=None):
......@@ -426,12 +437,6 @@ class InputFile(Parameter, AbstractIOFile):
Parameter.__init__(self, name, help, flag=flag, default=default, type=type, choices=choices,
required=required, group=group, display_name=display_name)
class AbstractOutputFile(AbstractIOFile):
"""
@summary : Parent of all OutputFile(s) parameters.
"""
pass
class OutputFile(Parameter, AbstractOutputFile):
def __new__(self, name, help, file_format="any", default="", choices=None,
......@@ -458,7 +463,7 @@ class ParameterList(list, AbstractParameter):
return list.__init__(self, default)
class InputFileList(ParameterList, AbstractIOFile):
class InputFileList(ParameterList, AbstractInputFile):
def __init__(self, name, help, file_format="any", default=None, type="localfile", choices=None,
required=False, flag=None, group="default", display_name=None):
......@@ -478,11 +483,9 @@ class InputFileList(ParameterList, AbstractIOFile):
if default.__class__.__name__ == "str":
return list.__init__(self, [default])
elif default.__class__.__name__ == "InputFile":
return list.__init__(self, default)
elif default.__class__.__name__ == "list":
return list.__init__(self, default)
elif default.__class__.__name__ == "InputFileList":
elif issubclass( default.__class__, AbstractInputFile ):
return list.__init__(self, default)
elif issubclass( default.__class__, AbstractOutputFile ):
return list.__init__(self, default)
......
Supports Markdown
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