OSDN Git Service

test: Update get-managed-objects to support Python 3
authorJohan Hedberg <johan.hedberg@intel.com>
Sat, 10 Nov 2012 10:05:08 +0000 (12:05 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Sat, 10 Nov 2012 10:05:08 +0000 (12:05 +0200)
test/get-managed-objects

index 5bbbe7d..3156f65 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/python
 
+from __future__ import absolute_import, print_function, unicode_literals
+
 import dbus
 
 bus = dbus.SystemBus()
@@ -10,7 +12,7 @@ manager = dbus.Interface(bus.get_object("org.bluez", "/"),
 objects = manager.GetManagedObjects()
 
 for path in objects.keys():
-       print "[ %s ]" % (path)
+       print("[ %s ]" % (path))
 
        interfaces = objects[path]
 
@@ -19,9 +21,9 @@ for path in objects.keys():
                                        "org.freedesktop.DBus.Properties"]:
                        continue
 
-               print "    %s" % (interface)
+               print("    %s" % (interface))
 
                properties = interfaces[interface]
 
                for key in properties.keys():
-                       print "      %s = %s" % (key, properties[key])
+                       print("      %s = %s" % (key, properties[key]))