From cec618e31bd2dd646f5c44791c4f131b722285a5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 31 Jan 2010 17:34:06 -0800 Subject: Fix service property monitoring handling --- test/monitor-services | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/test/monitor-services b/test/monitor-services index 9b293c7e..f1d7cf1c 100755 --- a/test/monitor-services +++ b/test/monitor-services @@ -13,11 +13,8 @@ def extract_values(values): val += " }" return val -def property_changed(name, value, path, interface): - iface = interface[interface.rfind(".") + 1:] - ipath = path[path.rfind("/") + 1:] - if iface not in ["Service"]: - return +def property_changed(name, value, path): + service = path[path.rfind("/") + 1:] if name in ["Profiles", "Services", "Providers", "Technologies", "Devices", "Networks"]: val = "[" @@ -30,7 +27,7 @@ def property_changed(name, value, path, interface): val = int(value) else: val = str(value) - print "{%s} [%s] %s = %s" % (iface, ipath, name, val) + print "[%s] %s = %s" % (service, name, val) if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) @@ -38,10 +35,10 @@ if __name__ == '__main__': bus = dbus.SystemBus() bus.add_signal_receiver(property_changed, - bus_name="org.moblin.connman", - signal_name = "PropertyChanged", - path_keyword="path", - interface_keyword="interface") + bus_name="org.moblin.connman", + dbus_interface="org.moblin.connman.Service", + signal_name = "PropertyChanged", + path_keyword="path") mainloop = gobject.MainLoop() mainloop.run() -- cgit v1.2.3