commit 1981aa7d5cac3b5d3e2c149ba9888b92f465a01f
parent bc76d63f61961d1a875ba32b07da7fbe8fc7a4d1
Author: SomberNight <somber.night@protonmail.com>
Date: Tue, 1 May 2018 16:37:38 +0200
trezor/keepkey: minor import clean-up.
Diffstat:
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/plugins/hw_wallet/cmdline.py b/plugins/hw_wallet/cmdline.py
@@ -1,5 +1,6 @@
from electrum.util import print_msg, print_error, raw_input
+
class CmdLineHandler:
def get_passphrase(self, msg, confirm):
@@ -12,7 +13,10 @@ class CmdLineHandler:
print_msg(msg)
print_msg("a b c\nd e f\ng h i\n-----")
o = raw_input()
- return ''.join(map(lambda x: t[x], o))
+ try:
+ return ''.join(map(lambda x: t[x], o))
+ except KeyError as e:
+ raise Exception("Character {} not in matrix!".format(e)) from e
def prompt_auth(self, msg):
import getpass
@@ -36,7 +40,7 @@ class CmdLineHandler:
print_msg(msg)
def update_status(self, b):
- print_error('trezor status', b)
+ print_error('hw device status', b)
def finished(self):
pass
diff --git a/plugins/keepkey/qt.py b/plugins/keepkey/qt.py
@@ -4,15 +4,17 @@ import threading
from PyQt5.Qt import Qt
from PyQt5.Qt import QGridLayout, QInputDialog, QPushButton
from PyQt5.Qt import QVBoxLayout, QLabel
-from electrum_gui.qt.util import *
-from .keepkey import KeepKeyPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
-from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
+from electrum_gui.qt.util import *
from electrum.i18n import _
from electrum.plugins import hook, DeviceMgr
from electrum.util import PrintError, UserCancelled, bh2u
from electrum.wallet import Wallet, Standard_Wallet
+from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
+from .keepkey import KeepKeyPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
+
+
PASSPHRASE_HELP_SHORT =_(
"Passphrases allow you to access new wallets, each "
"hidden behind a particular case-sensitive passphrase.")
diff --git a/plugins/trezor/qt.py b/plugins/trezor/qt.py
@@ -4,15 +4,17 @@ import threading
from PyQt5.Qt import Qt
from PyQt5.Qt import QGridLayout, QInputDialog, QPushButton
from PyQt5.Qt import QVBoxLayout, QLabel
-from electrum_gui.qt.util import *
-from .trezor import TrezorPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
-from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
+from electrum_gui.qt.util import *
from electrum.i18n import _
from electrum.plugins import hook, DeviceMgr
from electrum.util import PrintError, UserCancelled, bh2u
from electrum.wallet import Wallet, Standard_Wallet
+from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
+from .trezor import TrezorPlugin, TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
+
+
PASSPHRASE_HELP_SHORT =_(
"Passphrases allow you to access new wallets, each "
"hidden behind a particular case-sensitive passphrase.")