remove @staticmethod decorators

There might have been a time when calling a static method was faster
than a regular method, but that is no longer the case. According to
micro-benchmarks, it is 70% slower in CPython 3.13 and it also makes
executing the code of a class definition slower.
This commit is contained in:
Mike Fährmann
2025-06-12 22:13:46 +02:00
parent 8b6bc54e95
commit 811b665e33
68 changed files with 139 additions and 252 deletions

View File

@@ -20,8 +20,7 @@ class KomikcastBase():
category = "komikcast"
root = "https://komikcast02.com"
@staticmethod
def parse_chapter_string(chapter_string, data=None):
def parse_chapter_string(self, chapter_string, data=None):
"""Parse 'chapter_string' value and add its info to 'data'"""
if data is None:
data = {}
@@ -52,8 +51,7 @@ class KomikcastChapterExtractor(KomikcastBase, ChapterExtractor):
info = text.extr(page, "<title>", " - Komikcast<")
return self.parse_chapter_string(info)
@staticmethod
def images(page):
def images(self, page):
readerarea = text.extr(
page, '<div class="main-reading-area', '</div')
pattern = util.re(r"<img[^>]* src=[\"']([^\"']+)")
@@ -82,8 +80,7 @@ class KomikcastMangaExtractor(KomikcastBase, MangaExtractor):
results.append((url, data.copy()))
return results
@staticmethod
def metadata(page):
def metadata(self, page):
"""Return a dict with general metadata"""
manga , pos = text.extract(page, "<title>" , " - Komikcast<")
genres, pos = text.extract(