From 90a352153d975a05790e421fc866a099ff72f06c Mon Sep 17 00:00:00 2001 From: Hellow <74311245+HeIIow2@users.noreply.github.com> Date: Thu, 25 Apr 2024 23:58:25 +0200 Subject: [PATCH] feat: improved the printing of selections --- music_kraken/cli/main_downloader.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/music_kraken/cli/main_downloader.py b/music_kraken/cli/main_downloader.py index 36541fe..a45c01e 100644 --- a/music_kraken/cli/main_downloader.py +++ b/music_kraken/cli/main_downloader.py @@ -13,6 +13,8 @@ from ..utils.support_classes.query import Query from ..utils.support_classes.download_result import DownloadResult from ..utils.exception.download import UrlNotFoundException from ..utils.enums.colors import BColors +from .. import console + from ..download.results import Results, Option, PageResults from ..download.page_attributes import Pages from ..pages import Page @@ -174,12 +176,14 @@ class Downloader: page_count = 0 for option in self.current_results.formated_generator(max_items_per_page=self.max_displayed_options): if isinstance(option, Option): - color = BColors.BOLD.value if self.pages.is_downloadable(option.music_object) else BColors.GREY.value - print(f"{color}{option.index:0{self.option_digits}} {option.music_object.option_string}{BColors.ENDC.value}") + _downloadable = self.pages.is_downloadable(option.music_object) + + r = f"{BColors.GREY.value}{option.index:0{self.option_digits}}{BColors.ENDC.value} {option.music_object.option_string}" + print(r) else: prefix = ALPHABET[page_count % len(ALPHABET)] print( - f"{BColors.HEADER.value}({prefix}) ------------------------{option.__name__:{PAGE_NAME_FILL}<{MAX_PAGE_LEN}}------------{BColors.ENDC.value}") + f"{BColors.HEADER.value}({prefix}) --------------------------------{option.__name__:{PAGE_NAME_FILL}<{MAX_PAGE_LEN}}--------------------{BColors.ENDC.value}") self.page_dict[prefix] = option self.page_dict[option.__name__] = option