@@ -32,10 +32,10 @@ def extract_uuids(uuid_list):
objects = manager.GetManagedObjects()
-all_devices = (str(path) for path, interfaces in objects.iteritems() if
+all_devices = (str(path) for path, interfaces in objects.items() if
"org.bluez.Device1" in interfaces.keys())
-for path, interfaces in objects.iteritems():
+for path, interfaces in objects.items():
if "org.bluez.Adapter1" not in interfaces.keys():
continue
@@ -33,7 +33,7 @@ def unwrap(x):
return tuple(map(unwrap, x))
if isinstance(x, dict):
- return dict([(unwrap(k), unwrap(v)) for k, v in x.iteritems()])
+ return dict([(unwrap(k), unwrap(v)) for k, v in x.items()])
for t in [unicode, str, long, int, float, bool]:
if isinstance(x, t):
@@ -14,17 +14,17 @@ relevant_ifaces = [ "org.bluez.Adapter1", "org.bluez.Device1" ]
def property_changed(interface, changed, invalidated, path):
iface = interface[interface.rfind(".") + 1:]
- for name, value in changed.iteritems():
+ for name, value in changed.items():
val = str(value)
print("{%s.PropertyChanged} [%s] %s = %s" % (iface, path, name,
val))
def interfaces_added(path, interfaces):
- for iface, props in interfaces.iteritems():
+ for iface, props in interfaces.items():
if not(iface in relevant_ifaces):
continue
print("{Added %s} [%s]" % (iface, path))
- for name, value in props.iteritems():
+ for name, value in props.items():
print(" %s = %s" % (name, value))
def interfaces_removed(path, interfaces):
@@ -61,7 +61,7 @@ if (args[0] == "list"):
om = dbus.Interface(bus.get_object("org.bluez", "/"),
"org.freedesktop.DBus.ObjectManager")
objects = om.GetManagedObjects()
- for path, interfaces in objects.iteritems():
+ for path, interfaces in objects.items():
if "org.bluez.Adapter1" not in interfaces:
continue
@@ -49,7 +49,7 @@ if (args[0] == "list"):
"org.freedesktop.DBus.ObjectManager")
objects = om.GetManagedObjects()
- for path, interfaces in objects.iteritems():
+ for path, interfaces in objects.items():
if "org.bluez.Device1" not in interfaces:
continue
properties = interfaces["org.bluez.Device1"]
@@ -19,7 +19,7 @@ def print_compact(address, properties):
name = ""
address = "<unknown>"
- for key, value in properties.iteritems():
+ for key, value in properties.items():
if type(value) is dbus.String:
value = unicode(value).encode('ascii', 'replace')
if (key == "Name"):
@@ -153,7 +153,7 @@ if __name__ == '__main__':
om = dbus.Interface(bus.get_object("org.bluez", "/"),
"org.freedesktop.DBus.ObjectManager")
objects = om.GetManagedObjects()
- for path, interfaces in objects.iteritems():
+ for path, interfaces in objects.items():
if "org.bluez.Device1" in interfaces:
devices[path] = interfaces["org.bluez.Device1"]
@@ -147,7 +147,7 @@ manager = dbus.Interface(bus.get_object(BUS_NAME, "/"),
objects = manager.GetManagedObjects()
adapters = []
-for path, ifaces in objects.iteritems():
+for path, ifaces in objects.items():
if ifaces.has_key(ADAPTER_INTERFACE):
adapters.append(path)
@@ -172,7 +172,7 @@ while select == None:
adapter = dbus.Interface(bus.get_object(BUS_NAME, select), ADAPTER_INTERFACE)
devices = []
-for path, interfaces in objects.iteritems():
+for path, interfaces in objects.items():
if "org.bluez.Device1" not in interfaces:
continue
properties = interfaces["org.bluez.Device1"]
@@ -41,7 +41,7 @@ manager = dbus.Interface(bus.get_object(BUS_NAME, "/"),
objects = manager.GetManagedObjects()
adapters = []
-for path, ifaces in objects.iteritems():
+for path, ifaces in objects.items():
if ifaces.has_key(ADAPTER_INTERFACE):
adapters.append(path)
@@ -67,7 +67,7 @@ adapter = dbus.Interface(bus.get_object(BUS_NAME, select),
ADAPTER_INTERFACE)
devices = []
-for path, interfaces in objects.iteritems():
+for path, interfaces in objects.items():
if "org.bluez.Device1" not in interfaces:
continue
properties = interfaces["org.bluez.Device1"]