summaryrefslogtreecommitdiffstats
path: root/python/glib.py
blob: e1c3d9ca4c38d6dba99fae89828708220ad6647b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import dbus
import dbus_glib_bindings

def _setup_with_g_main(conn):
    dbus_glib_bindings.setup_with_g_main(conn._connection)

_dbus_gthreads_initialized = False
def threads_init():
    global _dbus_gthreads_initialized
    if not _dbus_gthreads_initialized:
        dbus_glib_bindings.gthreads_init()
        _dbus_gthreads_initialized = True

def init_threads():
    threads_init()

setattr(dbus, "_dbus_mainloop_setup_function", _setup_with_g_main)