tledger: cmdline plugin - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit d8e65782e10b1830011af6ad79572211884c254f DIR parent ddae2516c12bc10a7083d052fab1baefc097a129 HTML Author: ThomasV <thomasv@electrum.org> Date: Tue, 1 Dec 2015 12:06:21 +0100 ledger: cmdline plugin Diffstat: A plugins/ledger/cmdline.py | 28 ++++++++++++++++++++++++++++ M plugins/ledger/ledger.py | 24 ------------------------ 2 files changed, 28 insertions(+), 24 deletions(-) --- DIR diff --git a/plugins/ledger/cmdline.py b/plugins/ledger/cmdline.py t@@ -0,0 +1,28 @@ +from legder import LedgerPlugin +from electrum.util import print_msg +from electrum.plugins import hook + +class BTChipCmdLineHandler: + def stop(self): + pass + + def show_message(self, msg): + print_msg(msg) + + def prompt_auth(self, msg): + import getpass + print_msg(msg) + response = getpass.getpass('') + if len(response) == 0: + return None + return response + +class Plugin(LedgerPlugin): + @hook + def cmdline_load_wallet(self, wallet): + self.wallet = wallet + self.wallet.plugin = self + if self.handler is None: + self.handler = BTChipCmdLineHandler() + + DIR diff --git a/plugins/ledger/ledger.py b/plugins/ledger/ledger.py t@@ -496,27 +496,3 @@ class LedgerPlugin(BasePlugin): tx.error = str(e) -class CmdlinePlugin(LedgerPlugin): - @hook - def cmdline_load_wallet(self, wallet): - self.wallet = wallet - self.wallet.plugin = self - if self.handler is None: - self.handler = BTChipCmdLineHandler() - - -class BTChipCmdLineHandler: - - def stop(self): - pass - - def show_message(self, msg): - print_msg(msg) - - def prompt_auth(self, msg): - import getpass - print_msg(msg) - response = getpass.getpass('') - if len(response) == 0: - return None - return response