6 import dbus.mainloop.glib
8 def property_changed(name, value, path, interface):
9 iface = interface[interface.rfind(".") + 1:]
10 ipath = path[path.rfind("/") + 1:]
11 if iface not in ["Service"]:
13 if name in ["Profiles", "Services",
14 "Devices", "Networks", "Connections"]:
17 val = val + " " + i[i.rfind("/") + 1:]
19 elif name in ["Strength", "Priority"]:
23 print "{%s} [%s] %s = %s" % (iface, ipath, name, val)
25 if __name__ == '__main__':
26 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
28 bus = dbus.SystemBus()
30 bus.add_signal_receiver(property_changed,
31 bus_name="org.moblin.connman",
32 signal_name = "PropertyChanged",
34 interface_keyword="interface")
36 mainloop = gobject.MainLoop()