forked from Solthis/Fugen-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
59 lines (47 loc) · 1.64 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
57
58
59
# -*- coding: utf-8 -*
"""
Main module.
@author: Dimitri Justeau <dimitri.justeau@gmail.com>
"""
import sys
from PySide.QtGui import QApplication
from PySide.QtCore import QTranslator
from gui.mainwindow import MainWindow
import constants
import utils
import texts
if __name__ == '__main__':
app = QApplication(sys.argv)
translator = QTranslator()
translator.load(constants.QM_PATH)
app.installTranslator(translator)
mainwindow = MainWindow()
def excepthook(excType, excValue, tracebackobj):
msg_box = utils.getCriticalMessageBox(texts.GENERAL_ERROR_TITLE,
texts.GENERAL_ERROR_MSG)
msg_box.exec_()
app.exit()
sys.excepthook = excepthook
try:
from data.indicators.aggregation_indicators import *
load_aggregation_operators()
mainwindow.showMaximized()
app.exec_()
except AggregationIndicatorsError:
t = "Impossible de charger les indicateurs agrégés"
m = """
Assurez vous d'avoir correctement configuré les indicateurs
agrégés. Si le problème persiste, contactez Solthis.
"""
msg_box = utils.getCriticalMessageBox(t, m)
msg_box.exec_()
except KeyboardInterrupt:
pass
except:
t = "Une erreur est survenue pendant le démarrage du programme"
m = """
Assurez vous d'avoir correctement configuré l'outil, si le
problème persiste, contactez Solthis.
"""
msg_box = utils.getCriticalMessageBox(t, m)
msg_box.exec_()