diff --git a/menu.py b/menu.py index 2ff050a..4c69d4e 100644 --- a/menu.py +++ b/menu.py @@ -1,5 +1,3 @@ -from simple_term_menu import TerminalMenu -import dumb_menu from database import Database from scrapper import get_files, get_uri from utils import get_url, get @@ -10,9 +8,10 @@ uri = "" preview_site = {} preview_database = "" -def get_user_choice_by_menu(options: list, title = None, preview_function=None, preview_size: float = 0.3, show_search_hint: bool = False, skip_empty_entries = False): +def get_user_choice_by_menu(options: list, title = None, preview_command=None, preview_size: float = 0.3, show_search_hint: bool = False, skip_empty_entries = False): try: + from simple_term_menu import TerminalMenu None + 1; terminal_menu = TerminalMenu(options, preview_command=preview_function, @@ -22,6 +21,7 @@ def get_user_choice_by_menu(options: list, title = None, preview_function=None, skip_empty_entries=skip_empty_entries); response = terminal_menu.show(); except: + import dumb_menu response = dumb_menu.get_menu_choice(options); return (response);