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

@@ -43,7 +43,7 @@ class BbcGalleryExtractor(GalleryExtractor):
def images(self, page):
width = self.config("width")
width = width - width % 16 if width else 1920
dimensions = "/{}xn/".format(width)
dimensions = f"/{width}xn/"
results = []
for img in text.extract_iter(page, 'class="gallery__thumbnail', ">"):
@@ -64,7 +64,7 @@ class BbcGalleryExtractor(GalleryExtractor):
front, _, back = src.partition("/320x180_b/")
for width in (1920, 1600, 1280, 976):
if width < max_width:
yield "{}/{}xn/{}".format(front, width, back)
yield f"{front}/{width}xn/{back}"
class BbcProgrammeExtractor(Extractor):