-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsuivi.py
51 lines (39 loc) · 1.41 KB
/
suivi.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
"""
.d8888b. d8b d8b
d88P Y88b Y8P Y8P
Y88b.
"Y888b. 888 888 888 888 888 888
"Y88b. 888 888 888 888 888 888
"888 888 888 888 Y88 88P 888
Y88b d88P Y88b 888 888 Y8bd8P 888
"Y8888P" "Y88888 888 Y88P 888
"""
# the less import, the better for startup time
import sys
import PySimpleGUI as sg
from tracking.chrome import check_chrome
from windows.splash import Splash
from windows.theme import TH
PYTHON_MIN_VERSION = (3, 8)
TRACKERS_FILENAME = "Trackers"
LOAD_AS_JSON = True
TRANSLATION_MODULE = "deepl" # a module in the translation package (except translate)
def check_python(min_version):
print(f"Python {'.'.join(map(str, sys.version_info[:4]))} running")
if sys.version_info >= min_version:
return True
print(f"Python >= {'.'.join(map(str, min_version))} required")
return False
if __name__ == "__main__":
if check_python(PYTHON_MIN_VERSION) and check_chrome():
sg.theme(TH.theme)
# create splash before importing to reduce startup time
with Splash() as splash:
from windows.log import logger
from windows.main import MainWindow
args = TRACKERS_FILENAME, TRANSLATION_MODULE, LOAD_AS_JSON, splash
main_window = MainWindow(*args)
main_window.addlog(logger)
main_window.loop()
main_window.close()
logger.close()