dbus/python dbus.py,1.11,1.12 dbus_bindings.pyx.in,1.13,1.14

Anders Carlsson andersca at freedesktop.org
Wed Jul 28 11:14:57 PDT 2004


Update of /cvs/dbus/dbus/python
In directory pdx:/tmp/cvs-serv2879/python

Modified Files:
	dbus.py dbus_bindings.pyx.in 
Log Message:
2004-07-28  Anders Carlsson  <andersca at gnome.org>

	* python/dbus.py:
	* python/dbus_bindings.pyx.in:
	Add dbus.init_gthreads (), allow emit_signal to pass
	arguments to the signal.
	


Index: dbus.py
===================================================================
RCS file: /cvs/dbus/dbus/python/dbus.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- dbus.py	18 Jul 2004 21:44:37 -0000	1.11
+++ dbus.py	28 Jul 2004 18:14:55 -0000	1.12
@@ -43,6 +43,13 @@
 
 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 @@
         
         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):

Index: dbus_bindings.pyx.in
===================================================================
RCS file: /cvs/dbus/dbus/python/dbus_bindings.pyx.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- dbus_bindings.pyx.in	18 Jul 2004 21:44:37 -0000	1.13
+++ dbus_bindings.pyx.in	28 Jul 2004 18:14:55 -0000	1.14
@@ -18,6 +18,7 @@
                                                  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 @@
     
     if dbus_error_is_set(&error):
         raise DBusException, error.message
+
+def init_gthreads ():
+        dbus_g_thread_init ()



More information about the dbus-commit mailing list