-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
56 lines (48 loc) · 1.87 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from rich import print
from data.plugins import *
from rich.align import Align
from rich.panel import Panel
from rich.prompt import Prompt
side_functions = SideFunctions()
main_functions = MainFunctions(side_functions.config)
def main():
while True:
os.system("cls" if os.name == "nt" else "clear")
print(
Align.center(
Panel(
main_functions.tableGen(),
title="Available Downloads",
subtitle=f"Multi-Installer v{version}",
style="bold purple",
border_style="bold green",
)
)
)
print(
Align.center(
"\n[bold white][[bold yellow]settings[bold white]] [bold cyan]Modify settings\n[bold white][[bold yellow]status[bold white]] [bold cyan]Check link availability\n[bold white][[bold yellow]quit[bold white]] [bold red]Exit"
)
)
user_choice = Prompt.ask(
"\n[bold white][[bold yellow]>[bold white]] [bold cyan]Choice"
)
if user_choice.lower() in [
"exit",
"quit",
"stop",
]:
print(Align.center("[bold red]Exiting..."))
exit()
elif user_choice.lower() in ["status", "check", "check status"]:
main_functions.checkLinkStatuses()
elif user_choice.lower() in ["settings", "setting"]:
side_functions.displaySettings()
elif user_choice in choices.keys():
main_functions.download_and_run(user_choice)
main_functions.cleanUpFiles(user_choice, Path(__file__).resolve().parent)
time.sleep(2)
if __name__ == "__main__":
os.system("cls" if os.name == "nt" else "clear")
side_functions.cleanUpCache() # Prevent Python from writing bytecode to .pyc files and __pycache__ directories
main()