summaryrefslogtreecommitdiffstats
path: root/python/_dbus.py
diff options
context:
space:
mode:
authorRobert McQueen <robot101@debian.org>2006-02-15 23:45:50 +0000
committerRobert McQueen <robot101@debian.org>2006-02-15 23:45:50 +0000
commit397b0a4ec150c4400de8a041d077c819f6e978bd (patch)
tree4d4f13752e02db90fed751fb933d10fda961fbdd /python/_dbus.py
parent08bbc0210c243cb1c7e41d0c434fc069c7b2743c (diff)
2006-02-16 Robert McQueen <robot101@debian.org>
* glib/dbus-gmain.c: Make the previous commit compile. * python/_dbus.py, python/matchrules.py: Patch from Ole Andre Ravnaas <ole.andre.ravnaas@collabora.co.uk> to allow you to specify sender_keyword="foo", path_keyword="bar" when adding a signal listener, so that you can bind to signals generically but still do something useful in your callback. * python/dbus_bindings.pyx: Demarshal the byte type as unsigned chars so that they're not cast to chars and made negative. Thanks to Jakub Stachowski for reporting this and testing the fix.
Diffstat (limited to 'python/_dbus.py')
-rw-r--r--python/_dbus.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/_dbus.py b/python/_dbus.py
index 2376f172..7e17d9f6 100644
--- a/python/_dbus.py
+++ b/python/_dbus.py
@@ -158,6 +158,8 @@ class Bus(object):
args_dict[num] = value
except ValueError:
raise TypeError("Invalid arg index %s"%snum)
+ elif key in ("sender_keyword", "path_keyword"):
+ pass
else:
raise TypeError("Unknown keyword %s"%(key))
@@ -178,6 +180,12 @@ class Bus(object):
match_rule = SignalMatchRule(signal_name, dbus_interface, named_service, path)
+ for kw in ("sender_keyword", "path_keyword"):
+ if kw in keywords:
+ setattr(match_rule, kw, keywords[kw])
+ else:
+ setattr(match_rule, kw, None)
+
if args_dict:
match_rule.add_args_match(args_dict)