mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
wizard: add naive debug message to hw device scan if none are found
This commit is contained in:
parent
6eb38d6b8c
commit
13bd10e1cb
2 changed files with 10 additions and 1 deletions
|
@ -206,21 +206,28 @@ class BaseWizard(object):
|
|||
scanned_devices = devmgr.scan_devices()
|
||||
except BaseException as e:
|
||||
devmgr.print_error('error scanning devices: {}'.format(e))
|
||||
debug_msg = ' {}:\n {}'.format(_('Error scanning devices'), e)
|
||||
else:
|
||||
debug_msg = ''
|
||||
for name, description, plugin in support:
|
||||
try:
|
||||
# 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))
|
||||
debug_msg += ' {}:\n {}\n'.format(plugin.name, e)
|
||||
continue
|
||||
devices += list(map(lambda x: (name, x), u))
|
||||
if not debug_msg:
|
||||
debug_msg = ' {}'.format(_('No exceptions encountered.'))
|
||||
if not devices:
|
||||
msg = ''.join([
|
||||
_('No hardware device detected.') + '\n',
|
||||
_('To trigger a rescan, press \'Next\'.') + '\n\n',
|
||||
_('If your device is not detected on Windows, go to "Settings", "Devices", "Connected devices", and do "Remove device". Then, plug your device again.') + ' ',
|
||||
_('On Linux, you might have to add a new permission to your udev rules.'),
|
||||
_('On Linux, you might have to add a new permission to your udev rules.') + '\n\n',
|
||||
_('Debug message') + '\n',
|
||||
debug_msg
|
||||
])
|
||||
self.confirm_dialog(title=title, message=msg, run_next= lambda x: self.choose_hw_device(purpose))
|
||||
return
|
||||
|
|
|
@ -461,6 +461,8 @@ class DeviceMgr(ThreadJob, PrintError):
|
|||
def unpaired_device_infos(self, handler, plugin, devices=None):
|
||||
'''Returns a list of DeviceInfo objects: one for each connected,
|
||||
unpaired device accepted by the plugin.'''
|
||||
if not plugin.libraries_available:
|
||||
raise Exception('Missing libraries for {}'.format(plugin.name))
|
||||
if devices is None:
|
||||
devices = self.scan_devices()
|
||||
devices = [dev for dev in devices if not self.xpub_by_id(dev.id_)]
|
||||
|
|
Loading…
Add table
Reference in a new issue