Пример #1
0
def start():
    gi.require_version('GIRepository', '2.0')
    gi.require_version('Gtk', '3.0')
    gi.require_version('WebKit2', '4.0')

    config_logger()
    install_excepthook()

    from choral.application import Application

    application = Application()
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    status = application.run(sys.argv)
    sys.exit(status)
Пример #2
0
def start():
    gi.require_version("GIRepository", "2.0")
    gi.require_version("Gtk", "3.0")
    gi.require_version("WebKit2", "4.0")

    config_logger()
    install_excepthook()

    from choral.application import Application

    application = Application()
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    status = application.run(sys.argv)
    sys.exit(status)
Пример #3
0
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)


def install_excepthook():
    """ Make sure we exit when an unhandled exception occurs. """
    from gi.repository import Gtk
    old_hook = sys.excepthook

    def new_hook(etype, evalue, etb):
        old_hook(etype, evalue, etb)
        while Gtk.main_level():
            Gtk.main_quit()
        sys.exit()

    sys.excepthook = new_hook


if __name__ == "__main__":
    gi.require_version('GIRepository', '2.0')
    gi.require_version('Gtk', '3.0')
    install_excepthook()

    from choral.application import Application

    application = Application()
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    status = application.run(sys.argv)
    sys.exit(status)