6 if (len(sys.argv) < 2):
8 print "%s <service> direct" % (sys.argv[0])
9 print "%s <service> manual [servers=uri1,uri2,...] [excludes=host1,host2,...]" % (sys.argv[0])
10 print "%s <service> auto url=[pac-url]" % (sys.argv[0])
11 print "Example: %s service0 manual servers=proxy.example.com:8080" % sys.argv[0]
12 print " This would set the proxy uri and the method to manual"
15 bus = dbus.SystemBus()
16 path = "/net/connman/service/" + sys.argv[1]
17 service = dbus.Interface(bus.get_object('net.connman', path),
18 'net.connman.Service')
20 values = { "Method" : sys.argv[2] }
22 properties = service.GetProperties()
24 for arg in sys.argv[3:]:
25 if arg.startswith("url="):
26 url = arg.replace("url=", "", 1)
28 if arg.startswith("servers="):
30 servers_uris = arg.replace("servers=","",1).split(",")
33 values["Servers"] = servers_uris
34 if arg.startswith("excludes="):
36 excludes_uris = arg.replace("excludes=","",1).split(",")
39 values["Excludes"] = excludes_uris
42 service.SetProperty("Proxy.Configuration", dbus.Dictionary(values, signature='sv'))
43 except dbus.exceptions.DBusException, e_msg: