-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.py
51 lines (40 loc) · 1.08 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
import time
from system.lib.config import config
from system.lib.main_menu import (
check_auto_update,
check_files_updated,
menu,
refill_menu,
)
from system.localization import locale
try:
from loguru import logger
except ImportError:
raise RuntimeError("Please, install loguru using pip")
from system import clear
from system.lib.features.initialization import initialize
def main():
if not config.initialized:
config.change_language(locale.change())
if not config.initialized:
initialize(True)
exit()
check_auto_update()
check_files_updated()
refill_menu()
while True:
handler = menu.choice()
if handler is not None:
start_time = time.time()
with logger.catch():
handler()
logger.opt(colors=True).info(
f"<green>{locale.done % (time.time() - start_time)}</green>"
)
input(locale.to_continue)
clear()
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
logger.info("Exit.")