electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 27299092dfddc484b942fc661fc815d12741583a
parent 0429fe59601027582cfe3ccb36f10ffeb3313481
Author: SomberNight <somber.night@protonmail.com>
Date:   Tue, 29 Jan 2019 17:25:02 +0100

hardware cmdline handler: print messages to stderr (take 2)

follow-up 5613f9b903c6da799ec461d3a06b25ea0d0ee577

button_request should not call show_error as error dialogs in Qt block
the GUI thread.

Diffstat:
Melectrum/plugins/hw_wallet/cmdline.py | 16++++++++--------
Melectrum/plugins/trezor/clientbase.py | 2+-
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/electrum/plugins/hw_wallet/cmdline.py b/electrum/plugins/hw_wallet/cmdline.py @@ -1,17 +1,17 @@ -from electrum.util import print_msg, print_error, raw_input +from electrum.util import print_error, print_stderr, raw_input class CmdLineHandler: def get_passphrase(self, msg, confirm): import getpass - print_msg(msg) + print_stderr(msg) return getpass.getpass('') def get_pin(self, msg): t = { 'a':'7', 'b':'8', 'c':'9', 'd':'4', 'e':'5', 'f':'6', 'g':'1', 'h':'2', 'i':'3'} - print_msg(msg) - print_msg("a b c\nd e f\ng h i\n-----") + print_stderr(msg) + print_stderr("a b c\nd e f\ng h i\n-----") o = raw_input() try: return ''.join(map(lambda x: t[x], o)) @@ -20,24 +20,24 @@ class CmdLineHandler: def prompt_auth(self, msg): import getpass - print_msg(msg) + print_stderr(msg) response = getpass.getpass('') if len(response) == 0: return None return response def yes_no_question(self, msg): - print_msg(msg) + print_stderr(msg) return raw_input() in 'yY' def stop(self): pass def show_message(self, msg, on_cancel=None): - print_msg(msg) + print_stderr(msg) def show_error(self, msg, blocking=False): - print_error(msg) + print_stderr(msg) def update_status(self, b): print_error('hw device status', b) diff --git a/electrum/plugins/trezor/clientbase.py b/electrum/plugins/trezor/clientbase.py @@ -224,7 +224,7 @@ class TrezorClientBase(PrintError): def button_request(self, code): message = self.msg or MESSAGES.get(code) or MESSAGES['default'] - self.handler.show_error(message.format(self.device), self.client.cancel) + self.handler.show_message(message.format(self.device), self.client.cancel) def get_pin(self, code=None): if code == 2: