From fb3b7177dd0415312ef35996a4fe0fd8ebcde8d0 Mon Sep 17 00:00:00 2001 From: Wolfgang Maier Date: Tue, 24 Sep 2024 11:46:26 +0200 Subject: [PATCH] Use format strings to form option values --- lib/galaxy/tools/parameters/basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index f017f0e69bcf..c33183430771 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -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 @@ -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