Agent.object_method#
- Agent.object_method(obj, method, *a, **kw)[source]#
Call DBus method of an object and handle reply as async events.
The event names are
{iface}.{method}:replyand{iface}.{method}:error.expect()of the:replyevent gives the return values asevent.values; of the:errorevent, the exception asevent.error.Pass
reply_handlerorerror_handlerin**kwto get the reply called directly, as with an ordinary asynchronousdbuscall. The events are queued either way.- Parameters:
obj (
dbus.Interface) – interface whose method to call.method (
str) – method name.*a – method arguments.
**kw – method keyword arguments, and the optional
reply_handleranderror_handlercallbacks.
Example
obj = dbus.Interface(bus.get_object(BUS_NAME, "/"), "org.freedesktop.DBus.ObjectManager") self.object_method(obj, "GetManagedObjects") event = self.expect("org.freedesktop.DBus.ObjectManager.GetManagedObjects:reply") objects = event.values[0]