trezor handler for cmd line
This commit is contained in:
parent
ae957f3736
commit
5ba9303291
|
@ -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 *
|
||||
|
@ -98,6 +98,10 @@ class Plugin(BasePlugin):
|
|||
def init_qt_app(self, app):
|
||||
self.handler = TrezorQtHandler(app)
|
||||
|
||||
@hook
|
||||
def init_cmdline(self):
|
||||
self.handler = TrezorCmdLineHandler()
|
||||
|
||||
@hook
|
||||
def load_wallet(self, wallet):
|
||||
self.wallet = wallet
|
||||
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue