""" [App documentation here] @author:[author], [year] """ import sys from PyQt5.Qt import QApplication from PyQt5.QtWidgets import QMessageBox from ui.window import MainWindow from updater import UpdateNeeded 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() try: updater.autoupdate() except UpdateNeeded: print("Veuillez patienter pendant la mise à jour automatique") sys.exit(0) # 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_()