dbus python signals

David Zeuthen david@fubar.dk
Mon, 24 Nov 2003 21:27:19 +0100


Hi Seth,

below is a small patch for the python bindings such that the payload of
a signal can be examined. There's also a function for removing a signal
handler. Ok to commit?

Thanks,
David

Index: dbus.py
===================================================================
RCS file: /cvs/dbus/dbus/python/dbus.py,v
retrieving revision 1.2
diff -u -r1.2 dbus.py
--- dbus.py     30 Sep 2003 02:40:49 -0000      1.2
+++ dbus.py     24 Nov 2003 20:20:35 -0000
@@ -75,7 +75,15 @@
         self._match_rule_to_receivers[match_rule].append(receiver)
          
         dbus_bindings.bus_add_match(self._connection, match_rule)
-
+
+    def remove_signal_receiver(self, receiver, interface=None,
service=None, path=None):
+        match_rule = self._get_match_rule(interface, service, path)
+
+        if self._match_rule_to_receivers.has_key(match_rule):
+            if
self._match_rule_to_receivers[match_rule].__contains__(receiver):
+               
self._match_rule_to_receivers[match_rule].remove(receiver)
+                dbus_bindings.bus_remove_match(self._connection,
match_rule)
+
     def get_connection(self):
         """Get the dbus_bindings.Connection object associated with this
Bus"""
         return self._connection
@@ -103,7 +111,7 @@
  
         if (self._match_rule_to_receivers.has_key(match_rule)):
             receivers = self._match_rule_to_receivers[match_rule]
-            args = [interface, member, service, path]
+            args = [interface, member, service, path, message]
             for receiver in receivers:
                 receiver(*args)