Compare commits
No commits in common. "850c68f3e5652fccb85758d9b80be6573b2d1ad0" and "49145a7d93b8e5e773a614417a7ca3d36127b492" have entirely different histories.
850c68f3e5
...
49145a7d93
@ -14,7 +14,7 @@ from ..utils.config import main_settings, write_config
|
|||||||
from ..utils.enums.colors import BColors
|
from ..utils.enums.colors import BColors
|
||||||
from ..utils.exception import MKInvalidInputException
|
from ..utils.exception import MKInvalidInputException
|
||||||
from ..utils.exception.download import UrlNotFoundException
|
from ..utils.exception.download import UrlNotFoundException
|
||||||
from ..utils.shared import HELP_MESSAGE, URL_PATTERN
|
from ..utils.shared import URL_PATTERN
|
||||||
from ..utils.string_processing import fit_to_file_system
|
from ..utils.string_processing import fit_to_file_system
|
||||||
from ..utils.support_classes.download_result import DownloadResult
|
from ..utils.support_classes.download_result import DownloadResult
|
||||||
from ..utils.support_classes.query import Query
|
from ..utils.support_classes.query import Query
|
||||||
@ -43,7 +43,6 @@ def get_genre():
|
|||||||
|
|
||||||
|
|
||||||
def help_message():
|
def help_message():
|
||||||
print(HELP_MESSAGE)
|
|
||||||
print()
|
print()
|
||||||
print(random.choice(main_settings["happy_messages"]))
|
print(random.choice(main_settings["happy_messages"]))
|
||||||
print()
|
print()
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
from ..utils import BColors
|
|
||||||
from ..utils.shared import get_random_message
|
from ..utils.shared import get_random_message
|
||||||
|
|
||||||
|
|
||||||
@ -42,6 +41,6 @@ def print_cute_message():
|
|||||||
|
|
||||||
AGREE_INPUTS = {"y", "yes", "ok"}
|
AGREE_INPUTS = {"y", "yes", "ok"}
|
||||||
def ask_for_bool(msg: str) -> bool:
|
def ask_for_bool(msg: str) -> bool:
|
||||||
i = input(f"{msg} ({BColors.OKGREEN.value}Y{BColors.ENDC.value}/{BColors.FAIL.value}N{BColors.ENDC.value})? ").lower()
|
i = input(msg + " (Y/N):").lower()
|
||||||
return i in AGREE_INPUTS
|
return i in AGREE_INPUTS
|
||||||
|
|
@ -28,8 +28,6 @@ class Option:
|
|||||||
|
|
||||||
self._raw_keys = set(keys or [])
|
self._raw_keys = set(keys or [])
|
||||||
self._raw_keys.add(self.text)
|
self._raw_keys.add(self.text)
|
||||||
self._raw_keys.add(self.value)
|
|
||||||
self._raw_keys.add(str(self.value))
|
|
||||||
self.keys = set(self.parse_key(key) for key in self._raw_keys)
|
self.keys = set(self.parse_key(key) for key in self._raw_keys)
|
||||||
|
|
||||||
def register_key(self, key: Any):
|
def register_key(self, key: Any):
|
||||||
@ -102,10 +100,10 @@ class Select:
|
|||||||
yield option
|
yield option
|
||||||
|
|
||||||
def __contains__(self, key: Any) -> bool:
|
def __contains__(self, key: Any) -> bool:
|
||||||
return self._parse_option_key(key) in self._key_to_option
|
return key in self._key_to_option
|
||||||
|
|
||||||
def __getitem__(self, key: Any) -> Option:
|
def __getitem__(self, key: Any) -> Option:
|
||||||
return self._key_to_option[self._parse_option_key(key)]
|
return self._key_to_option[key]
|
||||||
|
|
||||||
def create_option(self, key: Any, **kwargs) -> Option:
|
def create_option(self, key: Any, **kwargs) -> Option:
|
||||||
if not self.can_create_options:
|
if not self.can_create_options:
|
||||||
|
Loading…
Reference in New Issue
Block a user