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

1
terminal_menu Submodule

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