main.py 590 B

12345678910111213141516171819202122232425262728
  1. '''
  2. @author: olivier.massot, mars 2017
  3. '''
  4. import sys
  5. from PyQt5.Qt import QApplication, QMessageBox
  6. # import ipdb
  7. from Viewer import Viewer
  8. if __name__ == '__main__':
  9. app = QApplication(sys.argv)
  10. iface = Viewer()
  11. iface.show()
  12. SYS_HOOK = sys.excepthook
  13. def error_handler(typ, value, trace):
  14. while QApplication.overrideCursor():
  15. QApplication.restoreOverrideCursor()
  16. QMessageBox.critical(iface, typ.__name__, "{}".format(value))
  17. SYS_HOOK(typ, value, trace)
  18. sys.excepthook = error_handler
  19. r = app.exec_()
  20. sys.exit(r)