def main(config): use_qt_notifications = True handler_class = None try: if sys.platform.startswith('linux'): from plover.oslayer.log_dbus import DbusNotificationHandler handler_class = DbusNotificationHandler elif sys.platform.startswith('darwin'): from plover.oslayer.log_osx import OSXNotificationHandler handler_class = OSXNotificationHandler except Exception: log.info('could not import platform gui log', exc_info=True) if handler_class is not None: try: handler = handler_class() except Exception: log.info('could not initialize platform gui log', exc_info=True) else: log.add_handler(handler) use_qt_notifications = False # Setup internationalization support. install_gettext() app = Application(config, use_qt_notifications) app.run() del app return 0
def main(config): # Setup internationalization support. install_gettext() use_qt_notifications = not log.has_platform_handler() app = Application(config, use_qt_notifications) code = app.run() del app return code
def main(config): # Setup internationalization support. install_gettext() use_qt_notifications = not log.has_platform_handler() # Log GUI exceptions that make it back to the event loop. if sys.excepthook is sys.__excepthook__: sys.excepthook = default_excepthook app = Application(config, use_qt_notifications) code = app.run() del app return code