From 72190484227dfef83bd05b95a45c0e15b517cfc1 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Mon, 27 May 2024 13:55:18 +0200 Subject: [PATCH] feat: colored asking for bool --- music_kraken/cli/main_downloader.py | 3 ++- music_kraken/cli/utils.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/music_kraken/cli/main_downloader.py b/music_kraken/cli/main_downloader.py index 9bc0b37..ddd1ffc 100644 --- a/music_kraken/cli/main_downloader.py +++ b/music_kraken/cli/main_downloader.py @@ -14,7 +14,7 @@ from ..utils.config import main_settings, write_config from ..utils.enums.colors import BColors from ..utils.exception import MKInvalidInputException from ..utils.exception.download import UrlNotFoundException -from ..utils.shared import URL_PATTERN +from ..utils.shared import HELP_MESSAGE, URL_PATTERN from ..utils.string_processing import fit_to_file_system from ..utils.support_classes.download_result import DownloadResult from ..utils.support_classes.query import Query @@ -43,6 +43,7 @@ def get_genre(): def help_message(): + print(HELP_MESSAGE) print() print(random.choice(main_settings["happy_messages"])) print() diff --git a/music_kraken/cli/utils.py b/music_kraken/cli/utils.py index cfcaadc..1acfe33 100644 --- a/music_kraken/cli/utils.py +++ b/music_kraken/cli/utils.py @@ -1,3 +1,4 @@ +from ..utils import BColors from ..utils.shared import get_random_message @@ -41,6 +42,6 @@ def print_cute_message(): AGREE_INPUTS = {"y", "yes", "ok"} def ask_for_bool(msg: str) -> bool: - i = input(msg + " (Y/N):").lower() + i = input(f"{msg} ({BColors.OKGREEN.value}Y{BColors.ENDC.value}/{BColors.FAIL.value}N{BColors.ENDC.value})? ").lower() return i in AGREE_INPUTS \ No newline at end of file