summaryrefslogtreecommitdiffstats
path: root/python/examples/example-signal-recipient.py
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2005-02-11 19:51:18 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2005-02-11 19:51:18 +0000
commit38dad64aced7360e43de5670c10d484caff3defe (patch)
tree0e336e7346b729216e1cadecc93f1d4147cf92f2 /python/examples/example-signal-recipient.py
parentaa4f823781185fb18187714798795d7e4b0c9b65 (diff)
* python/dbus.py (class Sender): added to support dbus signals better
(Bus::add_signal_receiver): added expand_args parameter which defaults to True. When expand args is True the signal handler will pass the message arguments as parameters to the signal handler. If False revert to previous behavior where the signal handler must get the argument list from the message. This is to help port applications like HAL that have a tendancy to send variable length argument lists. self._match_rule_to_receivers is now a dict of dicts. (Bus::remove_signal_receiver): pop handler off the dict intead of removing it from a list (Bus::_signal_func): change signal handlers so that interface, signal_name, service, path and message are packed into a Sender object and that is passed to the handler. If expand_args is True extract the args list from the message and append it to the parameter list * python/dbus_bindings.pyx.in (class Signature): added to support signiature types (MessageIter::__init__): changed iteration limit to match D-BUS (MessageIter::get*): added INT16, UINT16, SIGNATURE, DICT_ENTRY, STRUCT and VARIENT type support (MessageIter::python_value_to_dbus_sig): made recursive to support recursive types (MessageIter::append*): added Signature, dict, tuple support * python/examples/example-client.py: added examples of getting tuples and dicts * python/examples/example-service.py: added examples of sending tuples and dicts * python/examples/example-signal-recipient.py: Fixed to handle new signal callback format
Diffstat (limited to 'python/examples/example-signal-recipient.py')
-rw-r--r--python/examples/example-signal-recipient.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/examples/example-signal-recipient.py b/python/examples/example-signal-recipient.py
index 65e5933a..b5306070 100644
--- a/python/examples/example-signal-recipient.py
+++ b/python/examples/example-signal-recipient.py
@@ -5,9 +5,9 @@ bus = dbus.SessionBus()
service = bus.get_service("org.designfu.TestService")
object = service.get_object("/org/designfu/TestService/object", "org.designfu.TestService")
-def hello_signal_handler(interface, signal_name, service, path, message):
+def hello_signal_handler(sender):
print ("Received signal '%s.%s' from object '%s%s'"
- % (interface, signal_name, service, path))
+ % (sender.interface, sender.signal_name, sender.service, sender.path))
object.connect_to_signal("hello", hello_signal_handler)