From 3238f944b30f509c7aa6a7810f710e38c2e96ff9 Mon Sep 17 00:00:00 2001 From: Hellow2 Date: Wed, 29 Mar 2023 13:39:55 +0200 Subject: [PATCH] implementedexample cli --- src/actual_donwload.py | 14 ++++++++++++-- src/music_kraken/pages/download_center/search.py | 5 ----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/actual_donwload.py b/src/actual_donwload.py index b0f1093..3631166 100644 --- a/src/actual_donwload.py +++ b/src/actual_donwload.py @@ -1,8 +1,16 @@ from music_kraken import pages +def cli(): + search = pages.Search() + + while True: + search.next_input(input(">> ")) + print(search) + + def search_pages(): - search = pages.Search("#a Happy Days") + search = pages.Search() print("metadata", search.pages) print("audio", search.audio_pages) @@ -18,5 +26,7 @@ def search_pages(): print(search) + + if __name__ == "__main__": - search_pages() + cli() diff --git a/src/music_kraken/pages/download_center/search.py b/src/music_kraken/pages/download_center/search.py index 421ec25..8b7ddd6 100644 --- a/src/music_kraken/pages/download_center/search.py +++ b/src/music_kraken/pages/download_center/search.py @@ -100,13 +100,11 @@ class MultiPageOptions: class Search(Download): def __init__( self, - query: str, pages: Tuple[Type[Page]] = page_attributes.ALL_PAGES, exclude_pages: Set[Type[Page]] = set(), exclude_shady: bool = False, max_displayed_options: int = 10, option_digits: int = 3, - dry: bool = False, ) -> None: super().__init__( pages=pages, @@ -121,9 +119,6 @@ class Search(Download): self._current_option: MultiPageOptions = self.next_options - if not dry: - self.search(query) - def __repr__(self): return self._current_option.__repr__()