commit 5ba93032915ff04de6c673c1472b4febe7bf43de
parent ae957f37364d0c61f6658c6b877d5efbc5e3c5a4
Author: ThomasV <thomasv@gitorious>
Date: Tue, 26 May 2015 09:08:54 +0200
trezor handler for cmd line
Diffstat:
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/plugins/trezor.py b/plugins/trezor.py
@@ -15,7 +15,7 @@ from electrum.i18n import _
from electrum.plugins import BasePlugin, hook, always_hook, run_hook
from electrum.transaction import deserialize
from electrum.wallet import BIP32_HD_Wallet
-from electrum.util import print_error
+from electrum.util import print_error, print_msg
from electrum.wallet import pw_decode, bip32_private_derivation, bip32_root
from electrum_gui.qt.util import *
@@ -99,6 +99,10 @@ class Plugin(BasePlugin):
self.handler = TrezorQtHandler(app)
@hook
+ def init_cmdline(self):
+ self.handler = TrezorCmdLineHandler()
+
+ @hook
def load_wallet(self, wallet):
self.wallet = wallet
if self.trezor_is_connected():
@@ -486,6 +490,17 @@ class TrezorGuiMixin(object):
return proto.WordAck(word=word)
+class TrezorCmdLineHandler:
+
+ def get_passphrase(self, msg):
+ print_msg(msg)
+ return raw_input()
+
+ def get_pin(self, msg):
+ print_msg(msg)
+ return raw_input()
+
+
class TrezorQtHandler:
def __init__(self, win):