* [PATCH BlueZ] test: changes for Python3
@ 2022-04-19 15:03 Diego Rondini
2022-04-19 16:41 ` [BlueZ] " bluez.test.bot
0 siblings, 1 reply; 3+ messages in thread
From: Diego Rondini @ 2022-04-19 15:03 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Diego Rondini
Remove some leftover usage of Python2 code. In particular replace
iteritems() with items() to fix the following error:
AttributeError: 'dbus.Dictionary' object has no attribute 'iteritems'
---
test/list-devices | 4 ++--
test/map-client | 2 +-
test/monitor-bluetooth | 6 +++---
test/test-adapter | 2 +-
test/test-device | 2 +-
test/test-discovery | 4 ++--
test/test-health | 4 ++--
test/test-health-sink | 4 ++--
8 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/test/list-devices b/test/list-devices
index b112556c3..618d2867b 100755
--- a/test/list-devices
+++ b/test/list-devices
@@ -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
diff --git a/test/map-client b/test/map-client
index a2d96ae5f..f44f512bd 100755
--- a/test/map-client
+++ b/test/map-client
@@ -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):
diff --git a/test/monitor-bluetooth b/test/monitor-bluetooth
index a3977e206..99f3c857c 100755
--- a/test/monitor-bluetooth
+++ b/test/monitor-bluetooth
@@ -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):
diff --git a/test/test-adapter b/test/test-adapter
index a216140ba..c56ba9577 100755
--- a/test/test-adapter
+++ b/test/test-adapter
@@ -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
diff --git a/test/test-device b/test/test-device
index a1e508166..c840f0565 100755
--- a/test/test-device
+++ b/test/test-device
@@ -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"]
diff --git a/test/test-discovery b/test/test-discovery
index eccc7c7e3..54fc51403 100755
--- a/test/test-discovery
+++ b/test/test-discovery
@@ -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"]
diff --git a/test/test-health b/test/test-health
index d6b437ed8..3e16c415d 100755
--- a/test/test-health
+++ b/test/test-health
@@ -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"]
diff --git a/test/test-health-sink b/test/test-health-sink
index 57665d2ba..13b9a6b04 100755
--- a/test/test-health-sink
+++ b/test/test-health-sink
@@ -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"]
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [BlueZ] test: changes for Python3
2022-04-19 15:03 [PATCH BlueZ] test: changes for Python3 Diego Rondini
@ 2022-04-19 16:41 ` bluez.test.bot
0 siblings, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-04-19 16:41 UTC (permalink / raw)
To: linux-bluetooth, diego.rondini
[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=633421
---Test result---
Test Summary:
CheckPatch PASS 1.50 seconds
GitLint FAIL 1.13 seconds
Prep - Setup ELL PASS 54.16 seconds
Build - Prep PASS 0.76 seconds
Build - Configure PASS 10.41 seconds
Build - Make PASS 1445.99 seconds
Make Check PASS 14.36 seconds
Make Check w/Valgrind PASS 511.25 seconds
Make Distcheck PASS 262.61 seconds
Build w/ext ELL - Configure PASS 9.94 seconds
Build w/ext ELL - Make PASS 1380.24 seconds
Incremental Build with patchesPASS 0.00 seconds
Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint with rule in .gitlint
Output:
[BlueZ] test: changes for Python3
6: B3 Line contains hard tab characters (\t): " AttributeError: 'dbus.Dictionary' object has no attribute 'iteritems'"
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [BlueZ] test: changes for Python3
2022-04-19 15:09 [PATCH BlueZ] " Diego Rondini
@ 2022-04-19 16:46 ` bluez.test.bot
0 siblings, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-04-19 16:46 UTC (permalink / raw)
To: linux-bluetooth, diego.rondini
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=633425
---Test result---
Test Summary:
CheckPatch PASS 1.47 seconds
GitLint FAIL 1.03 seconds
Prep - Setup ELL PASS 51.69 seconds
Build - Prep PASS 0.72 seconds
Build - Configure PASS 10.42 seconds
Build - Make PASS 1526.18 seconds
Make Check PASS 12.78 seconds
Make Check w/Valgrind PASS 536.49 seconds
Make Distcheck PASS 278.84 seconds
Build w/ext ELL - Configure PASS 10.43 seconds
Build w/ext ELL - Make PASS 1486.05 seconds
Incremental Build with patchesPASS 0.00 seconds
Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint with rule in .gitlint
Output:
[BlueZ] test: changes for Python3
6: B3 Line contains hard tab characters (\t): " AttributeError: 'dbus.Dictionary' object has no attribute 'iteritems'"
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-19 16:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 15:03 [PATCH BlueZ] test: changes for Python3 Diego Rondini
2022-04-19 16:41 ` [BlueZ] " bluez.test.bot
2022-04-19 15:09 [PATCH BlueZ] " Diego Rondini
2022-04-19 16:46 ` [BlueZ] " bluez.test.bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.