11# coding: utf-8
22from __future__ import unicode_literals , print_function
3+ from __future__ import absolute_import
34
5+ from builtins import input
6+ from builtins import next
7+ from builtins import range
48import base64
59import binascii
610import time
1519from prompt_toolkit .filters import Condition
1620import ed25519
1721
18- from client import OnlyKey , Message , MessageField
22+ from . client import OnlyKey , Message , MessageField
1923
2024only_key = OnlyKey ()
2125
@@ -71,16 +75,16 @@ def prompt_pin():
7175
7276 with open (privkey , 'rb' ) as f :
7377 raw_privkey = f .read ()
74- print
78+ print ()
7579 print ('Enter ECC key slot number to use (1 - 32) or enter 0 to list key labels' )
76- print
80+ print ()
7781 slot = int (input ())
7882
7983 while slot == 0 :
8084 ok .displaykeylabels ()
81- print
85+ print ()
8286 print ('Enter ECC key slot number to use (1 - 32) or enter 0 to list key labels' )
83- print
87+ print ()
8488 slot = int (input ())
8589
8690 slot = slot + 100 # ECC keys in slot 101 - 132
@@ -99,47 +103,47 @@ def prompt_pin():
99103 for msg in [Message .OKSETPIN ]:
100104 only_key .send_message (msg = msg )
101105 print (only_key .read_string ())
102- print
106+ print ()
103107 input ('Press the Enter key once you are done' )
104108 only_key .send_message (msg = msg )
105109 print (only_key .read_string ())
106110 only_key .send_message (msg = msg )
107111 print (only_key .read_string ())
108- print
112+ print ()
109113 input ('Press the Enter key once you are done' )
110114 only_key .send_message (msg = msg )
111115 print (only_key .read_string ())
112- print
116+ print ()
113117
114118 for msg in [Message .OKSETPDPIN ]:
115119 only_key .send_message (msg = msg )
116120 print (only_key .read_string () + ' for second profile' )
117- print
121+ print ()
118122 input ('Press the Enter key once you are done' )
119123 only_key .send_message (msg = msg )
120124 print (only_key .read_string () + ' for second profile' )
121125 only_key .send_message (msg = msg )
122126 print (only_key .read_string ())
123- print
127+ print ()
124128 input ('Press the Enter key once you are done' )
125129 only_key .send_message (msg = msg )
126130 print (only_key .read_string ())
127- print
131+ print ()
128132
129133 for msg in [Message .OKSETSDPIN ]:
130134 only_key .send_message (msg = msg )
131135 print (only_key .read_string ())
132- print
136+ print ()
133137 input ('Press the Enter key once you are done' )
134138 only_key .send_message (msg = msg )
135139 print (only_key .read_string ())
136140 only_key .send_message (msg = msg )
137141 print (only_key .read_string ())
138- print
142+ print ()
139143 input ('Press the Enter key once you are done' )
140144 only_key .send_message (msg = msg )
141145 print (only_key .read_string ())
142- print
146+ print ()
143147
144148 elif sys .argv [1 ] == 'getlabels' :
145149 tmp = {}
@@ -298,7 +302,7 @@ def prompt_pin():
298302
299303 elif sys .argv [1 ]:
300304 print ('Command not found' )
301- print
305+ print ()
302306
303307 else :
304308
@@ -328,22 +332,22 @@ def mprompt():
328332 for msg in [Message .OKSETPIN ]:
329333 only_key .send_message (msg = msg )
330334 print (only_key .read_string ())
331- print
335+ print ()
332336 input ('Press the Enter key once you are done' )
333337 only_key .send_message (msg = msg )
334338 print (only_key .read_string ())
335339 only_key .send_message (msg = msg )
336340 print (only_key .read_string ())
337- print
341+ print ()
338342 input ('Press the Enter key once you are done' )
339343 only_key .send_message (msg = msg )
340344 print (only_key .read_string ())
341- print
345+ print ()
342346
343347 for msg in [Message .OKSETPDPIN ]:
344348 only_key .send_message (msg = msg )
345349 print (only_key .read_string () + ' for second profile' )
346- print
350+ print ()
347351 input ('Press the Enter key once you are done' )
348352 only_key .send_message (msg = msg )
349353 print (only_key .read_string () + ' for second profile' )
@@ -353,22 +357,22 @@ def mprompt():
353357 input ('Press the Enter key once you are done' )
354358 only_key .send_message (msg = msg )
355359 print (only_key .read_string ())
356- print
360+ print ()
357361
358362 for msg in [Message .OKSETSDPIN ]:
359363 only_key .send_message (msg = msg )
360364 print (only_key .read_string ())
361- print
365+ print ()
362366 input ('Press the Enter key once you are done' )
363367 only_key .send_message (msg = msg )
364368 print (only_key .read_string ())
365369 only_key .send_message (msg = msg )
366370 print (only_key .read_string ())
367- print
371+ print ()
368372 input ('Press the Enter key once you are done' )
369373 only_key .send_message (msg = msg )
370374 print (only_key .read_string ())
371- print
375+ print ()
372376 elif data [0 ] == 'getlabels' :
373377 tmp = {}
374378 for slot in only_key .getlabels ():
0 commit comments