diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-09-02 03:48:46 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-09-02 03:48:46 -0700 |
commit | 3d2d2595781c78a447a27f19b5cde67cf9dbe966 (patch) | |
tree | 3ae84684783d4c380867f34563ec4753b3eb38c5 /test/monitor-ofono | |
parent | 57dce83f0f7d0707eff196d853f6b6284b9335f6 (diff) | |
download | ofono-3d2d2595781c78a447a27f19b5cde67cf9dbe966.tar.bz2 |
Add test script to monitor all PropertyChanged signals
Diffstat (limited to 'test/monitor-ofono')
-rwxr-xr-x | test/monitor-ofono | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/monitor-ofono b/test/monitor-ofono new file mode 100755 index 00000000..dbcd8469 --- /dev/null +++ b/test/monitor-ofono @@ -0,0 +1,28 @@ +#!/usr/bin/python + +import gobject + +import dbus +import dbus.mainloop.glib + +def property_changed(name, value, path, interface): + iface = interface[interface.rfind(".") + 1:] + if name in [""]: + val = int(value) + else: + val = str(value) + print "{%s} [%s] %s = %s" % (iface, path, name, val) + +if __name__ == '__main__': + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) + + bus = dbus.SystemBus() + + bus.add_signal_receiver(property_changed, + bus_name="org.ofono", + signal_name = "PropertyChanged", + path_keyword="path", + interface_keyword="interface") + + mainloop = gobject.MainLoop() + mainloop.run() |