replace old %-formatted and .format(…) strings with f-strings (#7671)
mostly using flynt https://github.com/ikamensh/flynt
This commit is contained in:
@@ -28,7 +28,7 @@ class _2chenThreadExtractor(Extractor):
|
||||
self.board, self.thread = match.groups()
|
||||
|
||||
def items(self):
|
||||
url = "{}/{}/{}".format(self.root, self.board, self.thread)
|
||||
url = f"{self.root}/{self.board}/{self.thread}"
|
||||
page = self.request(url, encoding="utf-8", notfound="thread").text
|
||||
data = self.metadata(page)
|
||||
yield Message.Directory, data
|
||||
@@ -89,7 +89,7 @@ class _2chenBoardExtractor(Extractor):
|
||||
self.board = match[1]
|
||||
|
||||
def items(self):
|
||||
url = "{}/{}/catalog".format(self.root, self.board)
|
||||
url = f"{self.root}/{self.board}/catalog"
|
||||
page = self.request(url, notfound="board").text
|
||||
data = {"_extractor": _2chenThreadExtractor}
|
||||
for thread in text.extract_iter(
|
||||
|
||||
Reference in New Issue
Block a user