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

@@ -24,7 +24,7 @@ class ArchitizerProjectExtractor(GalleryExtractor):
example = "https://architizer.com/projects/NAME/"
def __init__(self, match):
url = "{}/projects/{}/".format(self.root, match[1])
url = f"{self.root}/projects/{match[1]}/"
GalleryExtractor.__init__(self, match, url)
def metadata(self, page):
@@ -71,12 +71,11 @@ class ArchitizerFirmExtractor(Extractor):
self.firm = match[1]
def items(self):
url = url = "{}/firms/{}/?requesting_merlin=pages".format(
self.root, self.firm)
url = url = f"{self.root}/firms/{self.firm}/?requesting_merlin=pages"
page = self.request(url).text
data = {"_extractor": ArchitizerProjectExtractor}
for project in text.extract_iter(page, '<a href="/projects/', '"'):
if not project.startswith("q/"):
url = "{}/projects/{}".format(self.root, project)
url = f"{self.root}/projects/{project}"
yield Message.Queue, url, data