rename class methods so they don't use a dunder format
All checks were successful
ci/woodpecker/push/tests Pipeline was successful
All checks were successful
ci/woodpecker/push/tests Pipeline was successful
This commit is contained in:
parent
3336649ada
commit
0305631f78
3 changed files with 5 additions and 9 deletions
|
@ -12,7 +12,7 @@ from mangadlp.api.mangadex import Mangadex
|
||||||
|
|
||||||
class MangaDLP:
|
class MangaDLP:
|
||||||
"""Download Mangas from supported sites.
|
"""Download Mangas from supported sites.
|
||||||
After initialization, start the script with the function __main__().
|
After initialization, start the script with the function get_manga().
|
||||||
|
|
||||||
:param url_uuid: URL or UUID of the manga
|
:param url_uuid: URL or UUID of the manga
|
||||||
:param language: Manga language with country codes. "en" --> english
|
:param language: Manga language with country codes. "en" --> english
|
||||||
|
@ -50,9 +50,9 @@ class MangaDLP:
|
||||||
self.download_wait = download_wait
|
self.download_wait = download_wait
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
# prepare everything
|
# prepare everything
|
||||||
self.__prepare__()
|
self._prepare()
|
||||||
|
|
||||||
def __prepare__(self) -> None:
|
def _prepare(self) -> None:
|
||||||
# additional stuff
|
# additional stuff
|
||||||
# set manga format suffix
|
# set manga format suffix
|
||||||
if self.file_format and "." not in self.file_format:
|
if self.file_format and "." not in self.file_format:
|
||||||
|
@ -71,10 +71,6 @@ class MangaDLP:
|
||||||
self.manga_chapter_list = self.api.chapter_list
|
self.manga_chapter_list = self.api.chapter_list
|
||||||
self.manga_path = Path(f"{self.download_path}/{self.manga_title}")
|
self.manga_path = Path(f"{self.download_path}/{self.manga_title}")
|
||||||
|
|
||||||
def __main__(self):
|
|
||||||
# start flow
|
|
||||||
self.get_manga()
|
|
||||||
|
|
||||||
def pre_checks(self) -> None:
|
def pre_checks(self) -> None:
|
||||||
# prechecks userinput/options
|
# prechecks userinput/options
|
||||||
# no url and no readin list given
|
# no url and no readin list given
|
||||||
|
|
|
@ -49,7 +49,7 @@ def call_app(args):
|
||||||
args.wait,
|
args.wait,
|
||||||
args.verbose,
|
args.verbose,
|
||||||
)
|
)
|
||||||
mdlp.__main__()
|
mdlp.get_manga()
|
||||||
|
|
||||||
|
|
||||||
def get_args():
|
def get_args():
|
||||||
|
|
|
@ -19,7 +19,7 @@ def test_full_api_mangadex():
|
||||||
download_wait=0.5,
|
download_wait=0.5,
|
||||||
verbose=True,
|
verbose=True,
|
||||||
)
|
)
|
||||||
mdlp.__main__()
|
mdlp.get_manga()
|
||||||
|
|
||||||
assert manga_path.exists() and manga_path.is_dir()
|
assert manga_path.exists() and manga_path.is_dir()
|
||||||
assert chapter_path.exists() and chapter_path.is_file()
|
assert chapter_path.exists() and chapter_path.is_file()
|
||||||
|
|
Loading…
Reference in a new issue