trezor handler for cmd line
This commit is contained in:
@@ -15,7 +15,7 @@ from electrum.i18n import _
|
|||||||
from electrum.plugins import BasePlugin, hook, always_hook, run_hook
|
from electrum.plugins import BasePlugin, hook, always_hook, run_hook
|
||||||
from electrum.transaction import deserialize
|
from electrum.transaction import deserialize
|
||||||
from electrum.wallet import BIP32_HD_Wallet
|
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.wallet import pw_decode, bip32_private_derivation, bip32_root
|
||||||
|
|
||||||
from electrum_gui.qt.util import *
|
from electrum_gui.qt.util import *
|
||||||
@@ -98,6 +98,10 @@ class Plugin(BasePlugin):
|
|||||||
def init_qt_app(self, app):
|
def init_qt_app(self, app):
|
||||||
self.handler = TrezorQtHandler(app)
|
self.handler = TrezorQtHandler(app)
|
||||||
|
|
||||||
|
@hook
|
||||||
|
def init_cmdline(self):
|
||||||
|
self.handler = TrezorCmdLineHandler()
|
||||||
|
|
||||||
@hook
|
@hook
|
||||||
def load_wallet(self, wallet):
|
def load_wallet(self, wallet):
|
||||||
self.wallet = wallet
|
self.wallet = wallet
|
||||||
@@ -486,6 +490,17 @@ class TrezorGuiMixin(object):
|
|||||||
return proto.WordAck(word=word)
|
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:
|
class TrezorQtHandler:
|
||||||
|
|
||||||
def __init__(self, win):
|
def __init__(self, win):
|
||||||
|
|||||||
Reference in New Issue
Block a user