test: Add test script for getting managed objects

This commit is contained in:
Marcel Holtmann 2012-11-09 20:26:26 +01:00
parent 50380dccc9
commit fe6a611505

27
test/get-managed-objects Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/python
import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("org.bluez", "/"),
"org.freedesktop.DBus.ObjectManager")
objects = manager.GetManagedObjects()
for path in objects.keys():
print "[ %s ]" % (path)
interfaces = objects[path]
for interface in interfaces.keys():
if interface in ["org.freedesktop.DBus.Introspectable",
"org.freedesktop.DBus.Properties"]:
continue
print " %s" % (interface)
properties = interfaces[interface]
for key in properties.keys():
print " %s = %s" % (key, properties[key])