Browse Source

wizard hw devices: only scan once

3.2.x
SomberNight 7 years ago
parent
commit
aabd9f01ee
  1. 21
      lib/base_wizard.py

21
lib/base_wizard.py

@ -202,14 +202,19 @@ class BaseWizard(object):
# scan devices # scan devices
devices = [] devices = []
devmgr = self.plugins.device_manager devmgr = self.plugins.device_manager
for name, description, plugin in support: try:
try: scanned_devices = devmgr.scan_devices()
# FIXME: side-effect: unpaired_device_info sets client.handler except BaseException as e:
u = devmgr.unpaired_device_infos(None, plugin) devmgr.print_error('error scanning devices: {}'.format(e))
except: else:
devmgr.print_error("error", name) for name, description, plugin in support:
continue try:
devices += list(map(lambda x: (name, x), u)) # FIXME: side-effect: unpaired_device_info sets client.handler
u = devmgr.unpaired_device_infos(None, plugin, devices=scanned_devices)
except BaseException as e:
devmgr.print_error('error getting device infos for {}: {}'.format(name, e))
continue
devices += list(map(lambda x: (name, x), u))
if not devices: if not devices:
msg = ''.join([ msg = ''.join([
_('No hardware device detected.') + '\n', _('No hardware device detected.') + '\n',

Loading…
Cancel
Save