diff options
author | Anders Carlsson <andersca@codefactory.se> | 2004-07-28 18:14:55 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@codefactory.se> | 2004-07-28 18:14:55 +0000 |
commit | b72fe8c67d724d0f4637714a72e4e91c9487349f (patch) | |
tree | 059527a9ccbbc0cde99a767d1cc2fef64b2aec0d /python/dbus.py | |
parent | c3cac7a6bfcf4a1a73a40905f8e302f3d53dfb64 (diff) |
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.
Diffstat (limited to 'python/dbus.py')
-rw-r--r-- | python/dbus.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/python/dbus.py b/python/dbus.py index de42d74d..4b538970 100644 --- a/python/dbus.py +++ b/python/dbus.py @@ -43,6 +43,13 @@ print(dbus_object.ListServices()) 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. @@ -285,8 +292,12 @@ class Object: 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): |