コード例 #1
0
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
コード例 #2
0
ファイル: main.py プロジェクト: tux21b/plover
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
コード例 #3
0
ファイル: main.py プロジェクト: ohAitch/plover
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
コード例 #4
0
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