Skip to content

Commit

Permalink
Use format strings to form option values
Browse files Browse the repository at this point in the history
  • Loading branch information
wm75 committed Sep 24, 2024
1 parent 724c83f commit fb3b717
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/tools/parameters/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ def get_options(self, trans, other_values):
and dataset.metadata.element_is_set("column_names")
):
try:
options = [("c%s: %s" % (c, dataset.metadata.column_names[int(c) - 1]), c, False) for c in column_list]
options = [(f"c{c}: {dataset.metadata.column_names[int(c) - 1]}", c, False) for c in column_list]
except IndexError:
# ignore and rely on fallback
pass
Expand All @@ -1529,7 +1529,7 @@ def get_options(self, trans, other_values):
with open(dataset.get_file_name()) as f:
head = f.readline()
cnames = head.rstrip("\n\r ").split("\t")
options = [("c%s: %s" % (c, cnames[int(c) - 1]), c, False) for c in column_list]
options = [(f"c{c}: {cnames[int(c) - 1]}", c, False) for c in column_list]
except Exception:
# ignore and rely on fallback
pass
Expand Down

0 comments on commit fb3b717

Please sign in to comment.