Skip to content

Commit

Permalink
Merge pull request #17868 from mvdbeek/parse_extensions_as_lowercase_…
Browse files Browse the repository at this point in the history
…and_stripped

[23.1] Normalize extensions when loading tool
  • Loading branch information
mvdbeek authored Mar 29, 2024
2 parents 67ed6a7 + 45c4675 commit 95a3797
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/galaxy/tools/parameters/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1864,11 +1864,10 @@ def _parse_formats(self, trans, input_source):
"""
Build list of classes for supported data formats
"""
self.extensions = input_source.get("format", "data").split(",")
self.extensions = [extension.strip().lower() for extension in input_source.get("format", "data").split(",")]
formats = []
if self.datatypes_registry: # This may be None when self.tool.app is a ValidationContext
normalized_extensions = [extension.strip().lower() for extension in self.extensions]
for extension in normalized_extensions:
for extension in self.extensions:
datatype = self.datatypes_registry.get_datatype_by_extension(extension)
if datatype is not None:
formats.append(datatype)
Expand Down

0 comments on commit 95a3797

Please sign in to comment.