wizard: trezor init
This commit is contained in:
@@ -178,12 +178,13 @@ class BaseWizard(object):
|
||||
return
|
||||
# scan devices
|
||||
devices = []
|
||||
devmgr = self.plugins.device_manager
|
||||
for name, description, plugin in support:
|
||||
devmgr = plugin.device_manager()
|
||||
try:
|
||||
u = devmgr.unpaired_device_infos(self, plugin)
|
||||
# FIXME: side-effect: unpaired_device_info sets client.handler
|
||||
u = devmgr.unpaired_device_infos(None, plugin)
|
||||
except:
|
||||
print "error", name
|
||||
devmgr.print_error("error", name)
|
||||
continue
|
||||
devices += map(lambda x: (name, x), u)
|
||||
if not devices:
|
||||
@@ -209,6 +210,7 @@ class BaseWizard(object):
|
||||
from keystore import hardware_keystore, bip44_derivation
|
||||
derivation = bip44_derivation(int(account_id))
|
||||
plugin = self.plugins.get_plugin(hw_type)
|
||||
self.plugin = plugin
|
||||
xpub = plugin.setup_device(device_info, derivation, self)
|
||||
# create keystore
|
||||
d = {
|
||||
|
||||
@@ -437,8 +437,6 @@ class DeviceMgr(ThreadJob, PrintError):
|
||||
if devices is None:
|
||||
devices = self.scan_devices()
|
||||
devices = [dev for dev in devices if not self.xpub_by_id(dev.id_)]
|
||||
|
||||
states = [_("wiped"), _("initialized")]
|
||||
infos = []
|
||||
for device in devices:
|
||||
if not device.product_key in plugin.DEVICE_IDS:
|
||||
@@ -446,7 +444,7 @@ class DeviceMgr(ThreadJob, PrintError):
|
||||
client = self.create_client(device, handler, plugin)
|
||||
if not client:
|
||||
continue
|
||||
state = states[client.is_initialized()]
|
||||
state = _("initialized") if client.is_initialized() else _("wiped")
|
||||
label = client.label() or _("An unnamed %s") % plugin.device
|
||||
descr = "%s (%s)" % (label, state)
|
||||
infos.append(DeviceInfo(device, descr, client.is_initialized()))
|
||||
|
||||
Reference in New Issue
Block a user