-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunme.py
More file actions
32 lines (25 loc) · 1008 Bytes
/
runme.py
File metadata and controls
32 lines (25 loc) · 1008 Bytes
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
from src.utils import prepare_data_location_and_files, run_db_migrations, setup_logging
# Prepare the data location and files. meeds to be done before importing the main application
setup_logging()
prepare_data_location_and_files()
run_db_migrations()
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