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

@@ -26,7 +26,7 @@ class ArcaliveExtractor(Extractor):
for article in self.articles():
article["_extractor"] = ArcalivePostExtractor
board = self.board or article.get("boardSlug") or "breaking"
url = "{}/b/{}/{}".format(self.root, board, article["id"])
url = f"{self.root}/b/{board}/{article['id']}"
yield Message.Queue, url, article
@@ -51,8 +51,8 @@ class ArcalivePostExtractor(ArcaliveExtractor):
post["count"] = len(files)
post["date"] = text.parse_datetime(
post["createdAt"][:19], "%Y-%m-%dT%H:%M:%S")
post["post_url"] = post_url = "{}/b/{}/{}".format(
self.root, post["boardSlug"], post["id"])
post["post_url"] = post_url = \
f"{self.root}/b/{post['boardSlug']}/{post['id']}"
post["_http_headers"] = {"Referer": post_url + "?p=1"}
yield Message.Directory, post