add subgit

This commit is contained in:
starnakin 2023-05-28 00:16:46 +02:00
parent 445387dd80
commit 24a6dd1124
3 changed files with 8 additions and 15 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "terminal_menu"]
path = terminal_menu
url = git@git.chauvet.pro:starnakin/terminal_menu.git

19
menu.py
View File

@ -2,6 +2,7 @@ from database import Database
from scrapper import get_files, get_uri from scrapper import get_files, get_uri
from utils import get_url, get from utils import get_url, get
import platform import platform
from terminal_menu.Menu import Menu
uri = "" uri = ""
@ -9,21 +10,9 @@ preview_site = {}
preview_database = "" preview_database = ""
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): 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):
menu = Menu(options, title, preview_body_function=preview_command, preview_ratio=preview_size, skip_empty_option=skip_empty_entries
try: )
from simple_term_menu import TerminalMenu return (menu.show());
terminal_menu = TerminalMenu(options,
preview_command=preview_command,
title=title,
show_search_hint=show_search_hint,
preview_size=preview_size,
skip_empty_entries=skip_empty_entries);
response = terminal_menu.show();
except:
import dumb_menu
response = dumb_menu.get_menu_choice(options);
return (response);
def add_site(database: Database) -> dict: def add_site(database: Database) -> dict:
print("add a site:") print("add a site:")

1
terminal_menu Submodule

@ -0,0 +1 @@
Subproject commit 4d85721b8ac1083701c11d711f78abffcb7df05d