summaryrefslogtreecommitdiffstats
path: root/python/dbus_glib_bindings.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'python/dbus_glib_bindings.pyx')
-rw-r--r--python/dbus_glib_bindings.pyx19
1 files changed, 19 insertions, 0 deletions
diff --git a/python/dbus_glib_bindings.pyx b/python/dbus_glib_bindings.pyx
new file mode 100644
index 00000000..314fadad
--- /dev/null
+++ b/python/dbus_glib_bindings.pyx
@@ -0,0 +1,19 @@
+cdef extern from "dbus.h":
+ ctypedef struct DBusConnection
+
+cdef extern from "dbus-glib.h":
+ ctypedef struct GMainContext
+ cdef void dbus_connection_setup_with_g_main (DBusConnection *connection,
+ GMainContext *context)
+ cdef void dbus_g_thread_init ()
+
+cimport dbus_bindings
+import dbus_bindings
+
+def setup_with_g_main(conn):
+ cdef dbus_bindings.Connection connection
+ connection = conn
+ dbus_connection_setup_with_g_main(connection._get_conn(), NULL)
+
+def init_gthreads ():
+ dbus_g_thread_init ()