6 import dbus.mainloop.glib
8 def extract_values(values):
10 for key in values.keys():
11 val += " " + key + "="
12 if key in ["Servers", "Excludes"]:
13 val += extract_list(values[key])
15 val += str(values[key])
19 def extract_list(list):
26 def property_changed(name, value, path):
27 service = path[path.rfind("/") + 1:]
28 if name in ["Profiles", "Services", "Providers", "Technologies"]
31 val = val + " " + i[i.rfind("/") + 1:]
33 elif name in ["IPv4", "IPv4.Configuration",
34 "IPv6", "IPv6.Configuration",
35 "Proxy", "Proxy.Configuration", "Ethernet"]:
36 val = extract_values(value)
37 elif name in ["Nameservers", "Nameservers.Configuration",
38 "Domains", "Domains.Configuration"]:
39 val = extract_list(value)
40 elif name in ["Strength", "Priority"]:
44 print "[%s] %s = %s" % (service, name, val)
46 if __name__ == '__main__':
47 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
49 bus = dbus.SystemBus()
51 bus.add_signal_receiver(property_changed,
52 bus_name="org.moblin.connman",
53 dbus_interface="org.moblin.connman.Service",
54 signal_name = "PropertyChanged",
57 mainloop = gobject.MainLoop()