Browse Source

hardware wallets: handle when label is None

follow-up 56c3de0e1e
master
SomberNight 6 years ago
parent
commit
b8e4ce9ba1
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 4
      electrum/plugin.py
  2. 2
      electrum/plugins/hw_wallet/plugin.py

4
electrum/plugin.py

@ -314,7 +314,7 @@ class HardwarePluginToScan(NamedTuple):
exception: Optional[Exception]
PLACEHOLDER_HW_CLIENT_LABELS = {"", " "}
PLACEHOLDER_HW_CLIENT_LABELS = {None, "", " "}
class DeviceMgr(ThreadJob):
@ -511,7 +511,7 @@ class DeviceMgr(ThreadJob):
'receive will be unspendable.').format(plugin.device))
def unpaired_device_infos(self, handler, plugin: 'HW_PluginBase', devices: List['Device'] = None,
include_failing_clients=False):
include_failing_clients=False) -> List['DeviceInfo']:
'''Returns a list of DeviceInfo objects: one for each connected,
unpaired device accepted by the plugin.'''
if not plugin.libraries_available:

2
electrum/plugins/hw_wallet/plugin.py

@ -159,7 +159,7 @@ class HardwareClientBase:
"""True if initialized, False if wiped."""
raise NotImplementedError()
def label(self) -> str:
def label(self) -> Optional[str]:
"""The name given by the user to the device.
Note: labels are shown to the user to help distinguish their devices,

Loading…
Cancel
Save