7 import dbus.mainloop.glib
10 class Canceled(dbus.DBusException):
11 _dbus_error_name = "org.moblin.connman.Error.Canceled"
13 class Agent(dbus.service.Object):
16 @dbus.service.method("org.moblin.connman.Agent",
17 in_signature='', out_signature='')
22 @dbus.service.method("org.moblin.connman.Agent",
23 in_signature='oa{sv}',
24 out_signature='a{sv}')
25 def RequestInput(self, path, fields):
26 print "RequestInput (%s,%s)" % (path, fields)
29 response["Passphrase"] = self.passphrase
31 print "returning (%s)" % (response)
35 @dbus.service.method("org.moblin.connman.Agent",
36 in_signature='', out_signature='')
42 if __name__ == '__main__':
44 print "Usage: %s <passphrase>" % (sys.argv[0])
47 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
49 bus = dbus.SystemBus()
50 manager = dbus.Interface(bus.get_object('org.moblin.connman', "/"),
51 'org.moblin.connman.Manager')
54 object = Agent(bus, path)
55 object.passphrase = sys.argv[1]
57 manager.RegisterAgent(path)
59 mainloop = gobject.MainLoop()
62 #manager.UnregisterAgent(path)