-
Notifications
You must be signed in to change notification settings - Fork 0
/
runme.py
30 lines (23 loc) · 875 Bytes
/
runme.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
from src.utils import prepare_data_location_and_files, setup_logging
setup_logging()
prepare_data_location_and_files()
import logging
import sys
from PyQt6.QtWidgets import QApplication
from src.ui_mainwindow import MainWindow
from src.utils import get_additional_run_args, sync_theme
logger = logging.getLogger(__name__)
if __name__ == "__main__":
try:
app = QApplication(sys.argv + get_additional_run_args())
w = MainWindow()
# in case of active style change, also change theme, need to sync at start
# app.paletteChanged.connect(sync_theme)
# still keep the app running, even if the main window is closed (we use tray for the app)
QApplication.setQuitOnLastWindowClosed(False)
sync_theme()
w.show()
sys.exit(app.exec())
except Exception as e:
logger.exception(e)
raise