replace old %-formatted and .format(…) strings with f-strings (#7671)
mostly using flynt https://github.com/ikamensh/flynt
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user