replace 2-element f-strings with simple '+' concatenations

Python's 'ast' module and its 'NodeVisitor' class
were incredibly helpful in identifying these
This commit is contained in:
Mike Fährmann
2025-12-21 15:09:03 +01:00
parent d0f06be0d2
commit 00c6821a3f
74 changed files with 229 additions and 237 deletions

View File

@@ -25,7 +25,7 @@ class _2chThreadExtractor(Extractor):
def __init__(self, match):
tld = match[1]
self.root = f"https://2ch.{'org' if tld == 'hk' else tld}"
self.root = "https://2ch." + ("org" if tld == "hk" else tld)
Extractor.__init__(self, match)
def items(self):
@@ -71,14 +71,14 @@ class _2chBoardExtractor(Extractor):
def __init__(self, match):
tld = match[1]
self.root = f"https://2ch.{'su' if tld == 'hk' else tld}"
self.root = "https://2ch." + ("org" if tld == "hk" else tld)
Extractor.__init__(self, match)
def items(self):
base = f"{self.root}/{self.groups[1]}"
# index page
url = f"{base}/index.json"
url = base + "/index.json"
index = self.request_json(url)
index["_extractor"] = _2chThreadExtractor
for thread in index["threads"]: