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

@@ -27,8 +27,7 @@ class _4archiveThreadExtractor(Extractor):
self.board, self.thread = match.groups()
def items(self):
url = "{}/board/{}/thread/{}".format(
self.root, self.board, self.thread)
url = f"{self.root}/board/{self.board}/thread/{self.thread}"
page = self.request(url).text
data = self.metadata(page)
posts = self.posts(page)
@@ -99,12 +98,11 @@ class _4archiveBoardExtractor(Extractor):
def items(self):
data = {"_extractor": _4archiveThreadExtractor}
while True:
url = "{}/board/{}/{}".format(self.root, self.board, self.num)
url = f"{self.root}/board/{self.board}/{self.num}"
page = self.request(url).text
if 'class="thread"' not in page:
return
for thread in text.extract_iter(page, 'class="thread" id="t', '"'):
url = "{}/board/{}/thread/{}".format(
self.root, self.board, thread)
url = f"{self.root}/board/{self.board}/thread/{thread}"
yield Message.Queue, url, data
self.num += 1