Simplify the service monitoring test script
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 13 May 2009 02:32:29 +0000 (19:32 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 13 May 2009 02:32:29 +0000 (19:32 -0700)
test/monitor-services

index 1f8e661..2ee8473 100755 (executable)
@@ -7,6 +7,7 @@ import dbus.mainloop.glib
 
 def property_changed(name, value, path, interface):
        iface = interface[interface.rfind(".") + 1:]
 
 def property_changed(name, value, path, interface):
        iface = interface[interface.rfind(".") + 1:]
+       ipath = path[path.rfind("/") + 1:]
        if iface not in ["Manager", "Service"]:
                return
        if name in ["Profiles", "Services",
        if iface not in ["Manager", "Service"]:
                return
        if name in ["Profiles", "Services",
@@ -19,7 +20,7 @@ def property_changed(name, value, path, interface):
                val = int(value)
        else:
                val = str(value)
                val = int(value)
        else:
                val = str(value)
-       print "{%s} [%s] %s = %s" % (iface, path, name, val)
+       print "{%s} [%s] %s = %s" % (iface, ipath, name, val)
 
 if __name__ == '__main__':
        dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
 
 if __name__ == '__main__':
        dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)