Replace "Nothing selected" option with default value on select lists. Enable radio button for small lists.
Clemens BlanK
7 years ago
991 | 991 | |
992 | 992 | if is_selection_parameter(param): |
993 | 993 | param_type = "select" |
994 | if len(param.restrictions.choices) < 5: | |
995 | param_node.attrib["display"] = "radio" | |
994 | 996 | |
995 | 997 | if is_boolean_parameter(param): |
996 | 998 | param_type = "boolean" |
1044 | 1046 | raise InvalidModelException("Unrecognized restriction type [%(type)s] for parameter [%(name)s]" |
1045 | 1047 | % {"type": type(param.restrictions), "name": param.name}) |
1046 | 1048 | |
1047 | param_node.attrib["optional"] = str(not param.required) | |
1049 | if param_type == "select" and param.default in param.restrictions.choices: | |
1050 | param_node.attrib["optional"] = "False" | |
1051 | else: | |
1052 | param_node.attrib["optional"] = str(not param.required) | |
1048 | 1053 | |
1049 | 1054 | if param_type == "text": |
1050 | 1055 | # add size attribute... this is the length of a textbox field in Galaxy (it could also be 15x2, for instance) |