From 072f932206f1163b1849354e5322f325a1e6e68d Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Mon, 16 Mar 2020 16:00:55 -0400 Subject: [PATCH] ui: handle devices and receivers with no firmware information --- lib/solaar/cli/show.py | 5 +++-- lib/solaar/ui/window.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/solaar/cli/show.py b/lib/solaar/cli/show.py index 11eff53e..423247e3 100644 --- a/lib/solaar/cli/show.py +++ b/lib/solaar/cli/show.py @@ -73,8 +73,9 @@ def _print_device(dev): if dev.polling_rate: print (' Polling rate :', dev.polling_rate, 'ms (%dHz)' % (1000 // dev.polling_rate)) print (' Serial number:', dev.serial) - for fw in dev.firmware: - print (' %11s:' % fw.kind, (fw.name + ' ' + fw.version).strip()) + if dev.firmware: + for fw in dev.firmware: + print (' %11s:' % fw.kind, (fw.name + ' ' + fw.version).strip()) if dev.power_switch_location: print (' The power switch is located on the %s.' % dev.power_switch_location) diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py index 959e4c81..bed5dbba 100644 --- a/lib/solaar/ui/window.py +++ b/lib/solaar/ui/window.py @@ -525,8 +525,9 @@ def _update_details(button): yield (_("Serial"), '...') if read_all: - for fw in list(device.firmware): - yield (' ' + _(str(fw.kind)), (fw.name + ' ' + fw.version).strip()) + if device.firmware: + for fw in list(device.firmware): + yield (' ' + _(str(fw.kind)), (fw.name + ' ' + fw.version).strip()) elif device.kind is None or device.online: yield (' %s' % _("Firmware"), '...')