in_signature='', out_signature='')
def Release(self):
print("Release VPN agent")
- mainloop.quit()
def input_cookie(self):
response = {}
def Cancel(self):
print "Cancel"
+def vpnNameOwnerChanged(proxy):
+ if proxy:
+ print("vpnd is connected to system bus")
+ try:
+ path = "/test/vpn_agent"
+ vpn_manager = dbus.Interface(bus.get_object('net.connman.vpn',
+ "/"),
+ 'net.connman.vpn.Manager')
+ vpn_manager.RegisterAgent(path)
+ except:
+ print "vpn agent registered"
+ else:
+ print("vpnd is disconnected from system bus")
+ vpn_manager = None
+
def print_usage():
print "Usage:"
print "For hidden service:"
vpn_manager.RegisterAgent(path)
+ bus.watch_name_owner('net.connman.vpn', vpnNameOwnerChanged)
+
mainloop = gobject.MainLoop()
mainloop.run()