wizard/hw: cap transport string

follow-up 32af83b7ae
This commit is contained in:
SomberNight 2018-11-30 20:45:54 +01:00
parent ec5f406f49
commit 74f6ac27af
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -283,7 +283,9 @@ class BaseWizard(object):
for name, info in devices:
state = _("initialized") if info.initialized else _("wiped")
label = info.label or _("An unnamed {}").format(name)
descr = f"{label} [{name}, {state}, {info.device.transport_ui_string}]"
try: transport_str = info.device.transport_ui_string[:20]
except: transport_str = 'unknown transport'
descr = f"{label} [{name}, {state}, {transport_str}]"
choices.append(((name, info), descr))
msg = _('Select a device') + ':'
self.choice_dialog(title=title, message=msg, choices=choices, run_next= lambda *args: self.on_device(*args, purpose=purpose))