Codebase list ctdconverter / f9abffb
Merge pull request #24 from mwalzer/feature/issue21 [fix] suggestion to fix #21 chahuistle authored 6 years ago GitHub committed 6 years ago
1 changed file(s) with 7 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
10011001 # assume it's just text unless restrictions are provided
10021002 param_format = "text"
10031003 if param.restrictions is not None:
1004 # join all supported_formats for the file... this MUST be a _FileFormat
1005 if type(param.restrictions) is _FileFormat:
1006 param_format = ','.join(get_supported_file_types(param.restrictions.formats, supported_file_formats))
1004 # join all formats of the file, take mapping from supported_file if available for an entry
1005 if type(param.restrictions) is _FileFormat:
1006 param_format = ','.join([get_supported_file_types(i, supported_file_formats) if
1007 get_supported_file_types(i, supported_file_formats)
1008 else i for i in param.restrictions.formats])
10071009 else:
10081010 raise InvalidModelException("Expected 'file type' restrictions for input file [%(name)s], "
10091011 "but instead got [%(type)s]"
10101012 % {"name": param.name, "type": type(param.restrictions)})
1013
10111014 param_node.attrib["type"] = "data"
1012 param_node.attrib["format"] = param_format
1015 param_node.attrib["format"] = param_format
10131016 # in the case of multiple input set multiple flag
10141017 if param.is_list:
10151018 param_node.attrib["multiple"] = "true"