""" [App documentation here] @author:[author], [year] """ import logging import sys import traceback from PyQt5.Qt import QApplication from PyQt5.QtWidgets import QMessageBox from core import logging_ from ui.window import MainWindow try: # Necessary to ensure that stacktraces are printed when using PyQt5 # Tough, could make pythonw.exe crash import ipdb # @UnusedImport except: pass logger = logging.getLogger("hello") logging_.start("hello", level=10) # Configure how errors are processed sys_err = sys.excepthook def err_handler(typ, value, trace): QApplication.restoreOverrideCursor() logger.error("{}\n{}\n{}".format(typ.__name__, value, ''.join(traceback.format_tb(trace)))) QMessageBox.critical(mainw, "Erreur: {}".format(typ.__name__), """{}""".format(value)) sys_err(typ, value, trace) sys.excepthook = err_handler # Start UI app = QApplication(sys.argv) mainw = MainWindow() mainw.show() r = app.exec_()