Commit b72fe8c6 authored by Anders Carlsson's avatar Anders Carlsson
Browse files

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.
parent c3cac7a6
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
......
......@@ -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):
......
......@@ -18,6 +18,7 @@ cdef extern from "dbus-glib.h":
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)
......@@ -1136,3 +1137,6 @@ def bus_remove_match(Connection connection, rule):
if dbus_error_is_set(&error):
raise DBusException, error.message
def init_gthreads ():
dbus_g_thread_init ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment