From 97d8d85cfccf8d65ce3cf229ee265547d53ce149 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Aug 2009 23:24:06 -0700 Subject: Update simple agent example --- test/simple-agent | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/simple-agent b/test/simple-agent index cb3a6751..1279aa87 100755 --- a/test/simple-agent +++ b/test/simple-agent @@ -6,12 +6,25 @@ import dbus import dbus.service import dbus.mainloop.glib +class Canceled(dbus.DBusException): + _dbus_error_name = "org.moblin.connman.Error.Canceled" + class Agent(dbus.service.Object): @dbus.service.method("org.moblin.connman.Agent", in_signature='', out_signature='') def Release(self): print("Release") mainloop.quit() + @dbus.service.method("org.moblin.connman.Agent", + in_signature='o', out_signature='s') + def RequestPassphrase(self, service): + print "PassphraseRequested (%s)" % (service) + raise Canceled("Canceled") + + @dbus.service.method("org.moblin.connman.Agent", + in_signature='', out_signature='') + def Cancel(self): + print "Cancel" if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) -- cgit v1.2.3