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

@@ -86,7 +86,7 @@ class BatotoChapterExtractor(BatotoBase, ChapterExtractor):
ChapterExtractor.__init__(self, match, False)
self._init_root()
self.chapter_id = self.groups[1]
self.page_url = "{}/title/0/{}".format(self.root, self.chapter_id)
self.page_url = f"{self.root}/title/0/{self.chapter_id}"
def metadata(self, page):
extr = text.extract_from(page)
@@ -147,7 +147,7 @@ class BatotoMangaExtractor(BatotoBase, MangaExtractor):
MangaExtractor.__init__(self, match, False)
self._init_root()
self.manga_id = self.groups[1] or self.groups[2]
self.page_url = "{}/title/{}".format(self.root, self.manga_id)
self.page_url = f"{self.root}/title/{self.manga_id}"
def chapters(self, page):
extr = text.extract_from(page)
@@ -177,6 +177,6 @@ class BatotoMangaExtractor(BatotoBase, MangaExtractor):
data["date"] = text.parse_datetime(
extr('time="', '"'), "%Y-%m-%dT%H:%M:%S.%fZ")
url = "{}/title/{}".format(self.root, href)
url = f"{self.root}/title/{href}"
results.append((url, data.copy()))
return results