replace old %-formatted and .format(…) strings with f-strings (#7671)

mostly using flynt
https://github.com/ikamensh/flynt
This commit is contained in:
Mike Fährmann
2025-06-28 19:36:16 +02:00
parent f77e98b57d
commit 9dbe33b6de
167 changed files with 756 additions and 891 deletions

View File

@@ -40,8 +40,8 @@ class DeprecatedConfigConstAction(argparse.Action):
"""Set argparse const values as config values + deprecation warning"""
def __call__(self, parser, namespace, values, option_string=None):
sys.stderr.write(
"warning: {} is deprecated. Use {} instead.\n".format(
"/".join(self.option_strings), self.choices))
f"Warning: {'/'.join(self.option_strings)} is deprecated. "
f"Use {self.choices} instead.\n")
namespace.options.append(((), self.dest, self.const))
@@ -144,7 +144,7 @@ class UgoiraAction(argparse.Action):
}
namespace.options.append(((), "ugoira", "original"))
else:
parser.error("Unsupported Ugoira format '{}'".format(value))
parser.error(f"Unsupported Ugoira format '{value}'")
pp["name"] = "ugoira"
pp["whitelist"] = ("pixiv", "danbooru")