Print more detailed information about the signal
[connman] / test / monitor-connman
1 #!/usr/bin/python
2
3 import gobject
4
5 import dbus
6 import dbus.mainloop.glib
7
8 def property_changed(name, value, path, interface):
9         iface = interface[interface.rfind(".") + 1:]
10         print "{%s} [%s] %s = %s" % (iface, path, name, str(value))
11
12 if __name__ == '__main__':
13         dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
14
15         bus = dbus.SystemBus()
16
17         bus.add_signal_receiver(property_changed,
18                                         bus_name="org.moblin.connman",
19                                         signal_name = "PropertyChanged",
20                                                 path_keyword="path",
21                                                 interface_keyword="interface")
22
23         mainloop = gobject.MainLoop()
24         mainloop.run()