tizen 2.3 release
[framework/connectivity/bluez.git] / test / get-managed-objects
1 #!/usr/bin/python
2
3 from __future__ import absolute_import, print_function, unicode_literals
4
5 import dbus
6
7 bus = dbus.SystemBus()
8
9 manager = dbus.Interface(bus.get_object("org.bluez", "/"),
10                                         "org.freedesktop.DBus.ObjectManager")
11
12 objects = manager.GetManagedObjects()
13
14 for path in objects.keys():
15         print("[ %s ]" % (path))
16
17         interfaces = objects[path]
18
19         for interface in interfaces.keys():
20                 if interface in ["org.freedesktop.DBus.Introspectable",
21                                         "org.freedesktop.DBus.Properties"]:
22                         continue
23
24                 print("    %s" % (interface))
25
26                 properties = interfaces[interface]
27
28                 for key in properties.keys():
29                         print("      %s = %s" % (key, properties[key]))