6 import dbus.mainloop.glib
8 def extract_values(values):
10 for key in values.keys():
11 val += " " + key + "="
12 val += str(values[key])
16 def property_changed(name, value, path, interface):
17 iface = interface[interface.rfind(".") + 1:]
18 ipath = path[path.rfind("/") + 1:]
19 if iface not in ["Service"]:
21 if name in ["Profiles", "Services", "Providers", "Technologies",
22 "Devices", "Networks"]:
25 val = val + " " + i[i.rfind("/") + 1:]
27 elif name in ["IPv4", "IPv4.Configuration", "Proxy", "Ethernet"]:
28 val = extract_values(value)
29 elif name in ["Strength", "Priority"]:
33 print "{%s} [%s] %s = %s" % (iface, ipath, name, val)
35 if __name__ == '__main__':
36 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
38 bus = dbus.SystemBus()
40 bus.add_signal_receiver(property_changed,
41 bus_name="org.moblin.connman",
42 signal_name = "PropertyChanged",
44 interface_keyword="interface")
46 mainloop = gobject.MainLoop()