From: Marcel Holtmann Date: Fri, 12 Dec 2008 22:06:02 +0000 (+0100) Subject: Add script to monitor property changes X-Git-Tag: 0.2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1953b25126c327c1bbfeb351b8649c1c1f82c0a;p=platform%2Fupstream%2Fconnman.git Add script to monitor property changes --- diff --git a/test/Makefile.am b/test/Makefile.am index 1e38eff..e4ea64f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,6 +3,6 @@ EXTRA_DIST = get-state list-profiles list-connections \ list-devices enable-device disable-device start-scanning \ list-networks select-network disable-network create-network \ set-passphrase simple-agent show-introspection \ - test-manager test-compat + test-manager test-compat monitor-connman MAINTAINERCLEANFILES = Makefile.in diff --git a/test/monitor-connman b/test/monitor-connman new file mode 100755 index 0000000..86c7d42 --- /dev/null +++ b/test/monitor-connman @@ -0,0 +1,23 @@ +#!/usr/bin/python + +import gobject + +import dbus +import dbus.mainloop.glib + +def property_changed(name, value, path): + print "[%s] %s = %s" % (path, name, str(value)) + +if __name__ == '__main__': + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) + + bus = dbus.SystemBus() + manager = dbus.Interface(bus.get_object("org.moblin.connman", "/"), + "org.moblin.connman.Manager") + + bus.add_signal_receiver(property_changed, + signal_name = "PropertyChanged", + path_keyword="path") + + mainloop = gobject.MainLoop() + mainloop.run()