electrum-bitcoinprivate/plugins/trezor/cmdline.py

27 lines
659 B
Python
Raw Normal View History

2017-10-17 12:05:26 -07:00
from electrum.util import print_msg, raw_input
2017-08-27 20:30:56 -07:00
from .trezor import TrezorPlugin
2015-12-01 03:00:18 -08:00
class TrezorCmdLineHandler:
def get_passphrase(self, msg, confirm):
2015-12-01 03:00:18 -08:00
import getpass
print_msg(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-----")
o = raw_input()
return ''.join(map(lambda x: t[x], o))
def stop(self):
pass
def show_message(self, msg):
print_msg(msg)
class Plugin(TrezorPlugin):
handler = TrezorCmdLineHandler()