taccept command line arguments - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit e84d5245442122ece118607d3b2bf3ccf0eacb89
DIR parent a11a8e3a39aa7c65dfaacbdfef33b5c9f1e7e418
HTML Author: ThomasV <thomasv@gitorious>
Date: Wed, 9 Nov 2011 10:34:01 +0100
accept command line arguments
Diffstat:
M client/mnemonic.py | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
---
DIR diff --git a/client/mnemonic.py b/client/mnemonic.py
t@@ -1864,15 +1864,11 @@ def mn_decode( wlist ):
return out
-
-
if __name__ == '__main__':
import sys
- print len(words)
- key = '6a8657c1f2566290be460fd51bb9f7fc'
- ss = mn_encode(key)
- print key
- print ss
- print mn_decode(ss)
-
-
+ if len( sys.argv ) == 1:
+ print 'I need arguments: a hex string to encode, or a list of words to decode'
+ elif len( sys.argv ) == 2:
+ print ' '.join(mn_encode(sys.argv[1]))
+ else:
+ print mn_decode(sys.argv[1:])