Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- logging.basicConfig( level=LOG_LEVEL, format=LOG_FMT.format(name) )
- try:
- app = QtCore.QCoreApplication(sys.argv)
- QtDBus.QDBusConnection.sessionBus().registerService( "{}.{}.{}".format( DBUS_SERVICE,
- name,
- "CommandRelay" ) )
- relay = CommandRelay(name)
- except Exception:
- log.error( "Failed to create CommandRelay. process exiting." )
- raise
- try:
- app.exec_()
- except Exception:
- log.error( "Fatal exception occurred while running relay. Exiting." )
- raise
- finally:
- relay.destroy()
- log.info( "Exiting process now." )
- def onQuit( signum, stackframe ):
- """ Handle terminate signal """
- try:
- log.info( "Terminate signal received." )
- QtCore.QCoreApplication.quit()
- except Exception:
- log.exception( "Exception occured while terminating" )
- sys.exit(1)
- sys.exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement