main.py 856 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. """
  2. [App documentation here]
  3. @author:[author], [year]
  4. """
  5. import logging
  6. import sys
  7. import traceback
  8. from PyQt5.Qt import QApplication
  9. from PyQt5.QtWidgets import QMessageBox
  10. from core import logging_
  11. from core.logging_ import Logger
  12. from ui.window import MainWindow
  13. try:
  14. # Necessary to ensure that stacktraces are printed when using PyQt5
  15. # Tough, could make pythonw.exe crash
  16. import ipdb # @UnusedImport
  17. except:
  18. pass
  19. logger = Logger.get()
  20. # Configure how errors are processed
  21. sys_err = sys.excepthook
  22. def err_handler(typ, value, trace):
  23. QApplication.restoreOverrideCursor()
  24. QMessageBox.critical(mainw, "Erreur: {}".format(typ.__name__), """{}""".format(value))
  25. sys_err(typ, value, trace)
  26. sys.excepthook = err_handler
  27. # Start UI
  28. app = QApplication(sys.argv)
  29. mainw = MainWindow()
  30. mainw.show()
  31. r = app.exec_()