+2004-07-28 Anders Carlsson <andersca@gnome.org>
+
+ * python/dbus.py:
+ * python/dbus_bindings.pyx.in:
+ Add dbus.init_gthreads (), allow emit_signal to pass
+ arguments to the signal.
+
2004-07-24 Havoc Pennington <hp@redhat.com>
* AUTHORS: add some people, not really comprehensively, let me
import dbus_bindings
+_threads_initialized = 0
+def init_gthreads ():
+ global _threads_initialized
+ if not _threads_initialized:
+ dbus_bindings.init_gthreads ()
+ _threads_initialized = 1
+
class Bus:
"""A connection to a DBus daemon.
self._connection.register_object_path(object_path, self._unregister_cb, self._message_cb)
- def emit_signal(self, interface, signal_name):
+ def emit_signal(self, interface, signal_name, *args):
message = dbus_bindings.Signal(self._object_path, interface, signal_name)
+ iter = message.get_iter()
+ for arg in args:
+ iter.append(arg)
+
self._connection.send(message)
def _unregister_cb(self, connection):
GMainContext *context)
cdef void dbus_server_setup_with_g_main (DBusServer *server,
GMainContext *context)
+ cdef void dbus_g_thread_init ()
cdef extern from "Python.h":
void Py_XINCREF (object)
if dbus_error_is_set(&error):
raise DBusException, error.message
+
+def init_gthreads ():
+ dbus_g_thread_init ()