| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- """
- [App documentaion here]
- @author:[author], [year]
- """
- import sys
- from PyQt5.Qt import QApplication
- from PyQt5.QtWidgets import QMessageBox
- from ui.window import MainWindow
- import updater
- try:
- # Necessary to ensure that stacktraces are printed when using PyQt5
- # Tough, could make pythonw.exe crash
- import ipdb # @UnusedImport
- except:
- pass
- with open("VERSION") as f:
- __VERSION__ = f.read()
- updater.autoupdate()
- # Configure how errors are processed
- sys_err = sys.excepthook
- def gestionnaire_erreurs(typ, value, traceback):
- QApplication.restoreOverrideCursor()
- sys_err(typ, value, traceback)
- QMessageBox.critical(mainw, "Erreur: {}".format(typ.__name__), """{}""".format(value))
- with open("err.log", "w+") as f:
- f.write("{}: {}".format(typ.__name__, value))
- mainw.cancel()
- sys.excepthook = gestionnaire_erreurs
- # Start UI
- app = QApplication(sys.argv)
- mainw = MainWindow()
- mainw.show()
- r = app.exec_()
|