5 def extract_values(values):
7 for key in values.keys():
9 if key in ["PrefixLength"]:
10 val += "%s" % (int(values[key]))
12 val += str(values[key])
16 def extract_list(list):
23 bus = dbus.SystemBus()
25 manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"),
26 "org.moblin.connman.Manager")
28 properties = manager.GetProperties()
30 for path in properties["Services"]:
31 service = dbus.Interface(bus.get_object("org.moblin.connman", path),
32 "org.moblin.connman.Service")
34 properties = service.GetProperties()
36 print "[ %s ]" % (path)
38 for key in properties.keys():
39 if key in ["IPv4", "IPv4.Configuration",
40 "IPv6", "IPv6.Configuration",
41 "Proxy", "Proxy.Configuration",
42 "Ethernet", "Provider"]:
43 val = extract_values(properties[key])
44 elif key in ["Nameservers", "Nameservers.Configuration",
45 "Domains", "Domains.Configuration"]:
46 val = extract_list(properties[key])
47 elif key in ["Favorite", "Immutable", "AutoConnect",
48 "LoginRequired", "SetupRequired",
49 "PassphraseRequired"]:
50 if properties[key] == dbus.Boolean(1):
54 elif key in ["Strength"]:
55 val = int(properties[key])
58 print " %s = %s" % (key, val)