6 import dbus.mainloop.glib
8 def property_changed(name, value, path, interface):
9 iface = interface[interface.rfind(".") + 1:]
10 if iface not in ["Manager", "Service"]:
12 if name in ["Profiles", "Services",
13 "Devices", "Networks", "Connections"]:
16 val = val + " " + i[i.rfind("/") + 1:]
18 elif name in ["Strength", "Priority"]:
22 print "{%s} [%s] %s = %s" % (iface, path, name, val)
24 if __name__ == '__main__':
25 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
27 bus = dbus.SystemBus()
29 bus.add_signal_receiver(property_changed,
30 bus_name="org.moblin.connman",
31 signal_name = "PropertyChanged",
33 interface_keyword="interface")
35 mainloop = gobject.MainLoop()