diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2012-04-29 01:30:25 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-04-29 01:30:25 +0200 |
commit | d30c13d3b2415bbbf70462c1aedf272599b1cb75 (patch) | |
tree | ba9ccda2187b2b0d0d0b8cae4c3374a91bca2311 /test | |
parent | ef939d2ab843653a7d6ab03082cf46f3f87ceac8 (diff) | |
download | connman-d30c13d3b2415bbbf70462c1aedf272599b1cb75.tar.gz connman-d30c13d3b2415bbbf70462c1aedf272599b1cb75.tar.bz2 connman-d30c13d3b2415bbbf70462c1aedf272599b1cb75.zip |
test: Update service monitoring script
Diffstat (limited to 'test')
-rwxr-xr-x | test/monitor-services | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/monitor-services b/test/monitor-services index 81860688..c1b4cedc 100755 --- a/test/monitor-services +++ b/test/monitor-services @@ -44,6 +44,16 @@ def property_changed(name, value, path): val = str(value) print "[%s] %s = %s" % (service, name, val) +def services_changed(services, removed): + for i in services: + service = i[0][i[0].rfind("/") + 1:] + print "[%s] added / update" % (service) + for n in i[1].keys(): + property_changed(n, i[1][n], i[0]) + for i in removed: + service = i[i.rfind("/") + 1:] + print "[%s] removed" % (service) + if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) @@ -52,8 +62,13 @@ if __name__ == '__main__': bus.add_signal_receiver(property_changed, bus_name="net.connman", dbus_interface="net.connman.Service", - signal_name = "PropertyChanged", + signal_name="PropertyChanged", path_keyword="path") + bus.add_signal_receiver(services_changed, + bus_name="net.connman", + dbus_interface="net.connman.Manager", + signal_name="ServicesChanged") + mainloop = gobject.MainLoop() mainloop.run() |