How to use the gbulb.glib_events._GLibLoopImplem function in gbulb

To help you get started, we’ve selected a few gbulb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github davidedmundson / telepathy-hangups / gbulb / glib_events.py View on Github external
assert not (gtk and application is not None)

        if self._loop_implem is not None:
            raise RuntimeError('Event loop is running.')

        if application is not None:
            assert self._context == GLib.main_context_default()
            lh = _GApplicationLoopImplem(self, application)
        elif gtk or self._gtk:
            lh = _GtkLoopImplem(self)
        elif self._application is not None:
            lh = _GApplicationLoopImplem(self, self._application)
            self._application = None
        else:
            lh = _GLibLoopImplem(self)

        # We do not run the callbacks immediately. We need to call them
        # when the Gtk loop is running, in case one callback calls .stop()
        self._schedule_dispatch()

        try:
            self._loop_implem = lh

            lh.run()

            if self._interrupted:
                # ._interrupted is set when SIGINT is caught be the default
                # signal handler implemented in this module.
                #
                # If no user-defined handler is registered, then the default
                # behaviour is just to raise KeyboardInterrupt