~ubuntu-branches/debian/stretch/electrum/stretch

« back to all changes in this revision

Viewing changes to plugins/trezor/cmdline.py

  • Committer: Package Import Robot
  • Author(s): Tristan Seligmann
  • Date: 2016-04-04 03:02:39 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20160404030239-0szgkio8yryjv7c9
Tags: 2.6.3-1
* New upstream release.
  - Drop backported install-wizard-connect.patch.
* Add Suggests: python-zbar and update the installation hint to suggest
  apt-get instead of pip (closes: #819517).
* Bump Standards-Version to 3.9.7 (no changes).
* Update Vcs-* links.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from trezor import TrezorPlugin
 
2
from electrum.util import print_msg
 
3
 
 
4
class TrezorCmdLineHandler:
 
5
 
 
6
    def get_passphrase(self, msg, confirm):
 
7
        import getpass
 
8
        print_msg(msg)
 
9
        return getpass.getpass('')
 
10
 
 
11
    def get_pin(self, msg):
 
12
        t = { 'a':'7', 'b':'8', 'c':'9', 'd':'4', 'e':'5', 'f':'6', 'g':'1', 'h':'2', 'i':'3'}
 
13
        print_msg(msg)
 
14
        print_msg("a b c\nd e f\ng h i\n-----")
 
15
        o = raw_input()
 
16
        return ''.join(map(lambda x: t[x], o))
 
17
 
 
18
    def stop(self):
 
19
        pass
 
20
 
 
21
    def show_message(self, msg):
 
22
        print_msg(msg)
 
23
 
 
24
 
 
25
class Plugin(TrezorPlugin):
 
26
    handler = TrezorCmdLineHandler()