5 def extract_values(values):
7 for key in values.keys():
9 if key in ["PrefixLength"]:
10 val += "%s" % (int(values[key]))
12 if key in ["Servers", "Excludes"]:
13 val += extract_list(values[key])
15 val += str(values[key])
19 def extract_list(list):
26 bus = dbus.SystemBus()
28 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
29 "org.moblin.connman.Manager")
31 properties = manager.GetProperties()
33 for path in properties["Services"]:
34 service = dbus.Interface(bus.get_object("org.moblin.connman", path),
35 "org.moblin.connman.Service")
37 properties = service.GetProperties()
39 print "[ %s ]" % (path)
41 for key in properties.keys():
42 if key in ["IPv4", "IPv4.Configuration",
43 "IPv6", "IPv6.Configuration",
44 "Proxy", "Proxy.Configuration",
45 "Ethernet", "Provider"]:
46 val = extract_values(properties[key])
47 elif key in ["Nameservers", "Nameservers.Configuration",
48 "Domains", "Domains.Configuration"]:
49 val = extract_list(properties[key])
50 elif key in ["Favorite", "Immutable", "AutoConnect",
51 "LoginRequired", "SetupRequired",
52 "PassphraseRequired"]:
53 if properties[key] == dbus.Boolean(1):
57 elif key in ["Strength"]:
58 val = int(properties[key])
61 print " %s = %s" % (key, val)