From 7b9236f2aef06b203acc019592cd102672427633 Mon Sep 17 00:00:00 2001 From: Robert McQueen Date: Mon, 14 Nov 2005 02:53:30 +0000 Subject: 2005-11-14 Robert McQueen * python/decorators.py, python/service.py: Add a new argument to the dbus.service.method decorator called sender_keyword, which if set, specifies the name of an argument which will be provided the bus name of the method caller. * test/python/test-client.py, test/python/test-service.py: Add a method and test to check the sender_keyword functionality. --- python/service.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/service.py') diff --git a/python/service.py b/python/service.py index 3eec65f6..409fc78a 100644 --- a/python/service.py +++ b/python/service.py @@ -294,6 +294,10 @@ class Object(Interface): keywords[return_callback] = lambda *retval: _method_reply_return(connection, message, method_name, signature, *retval) keywords[error_callback] = lambda exception: _method_reply_error(connection, message, exception) + # include the sender if desired + if parent_method._dbus_sender_keyword: + keywords[parent_method._dbus_sender_keyword] = message.get_sender() + # call method retval = candidate_method(self, *args, **keywords) -- cgit