Added custom pywallet.py in scripts/

Features: prompt for password; dump keys to flat list
This commit is contained in:
philemon 2014-01-30 23:56:38 +04:00
commit d801580b76
6 changed files with 1773 additions and 6 deletions

View file

@ -30,6 +30,7 @@ mmgen/rpc/proxy.py
mmgen/rpc/util.py
scripts/bitcoind-walletunlock.py
scripts/deinstall.sh
scripts/pywallet.py
tests/addr.py
tests/bitcoin.py
tests/mn_electrum.py

View file

@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
mmgen-txcreate: Send BTC to specified addresses
mmgen-txcreate: Create a BTC transaction, sending to specified addresses
"""
import sys
@ -33,7 +33,7 @@ prog_name = sys.argv[0].split("/")[-1]
help_data = {
'prog_name': prog_name,
'desc': "Send BTC to specified addresses",
'desc': "Create a BTC transaction, sending to specified addresses",
'usage': "[opts] <address:amount>[,...] <transaction fee> <change address>",
'options': """
-h, --help Print this help message

View file

@ -224,9 +224,14 @@ View options: [g]roup, show [m]mgen addr
elif reply == 'g': group = False if group else True; break
elif reply == 'm': mmaddr = False if mmaddr else True; break
elif reply == 'p':
f = "listunspent.out"
write_to_file(f,"\n".join(output)+"\n")
msg("\nData written to '%s'" % f)
outfile = "listunspent.out"
o = "Date: {} UTC\n\n{}\n\nTotal BTC: {}\n".format(
make_timestr(),
"\n".join(output),
trim_exponent(sum([i.amount for i in unspent]))
)
write_to_file(outfile, o)
msg("\nData written to '%s'" % outfile)
sys.exit(1)
elif reply == 'q': break
else: msg("Invalid input")

View file

@ -516,6 +516,11 @@ def make_timestamp():
tv = time.gmtime(time.time())[:6]
return "{:04d}{:02d}{:02d}_{:02d}{:02d}{:02d}".format(*tv)
def make_timestr():
import time
tv = time.gmtime(time.time())[:6]
return "{:04d}/{:02d}/{:02d} {:02d}:{:02d}:{:02d}".format(*tv)
def write_wallet_to_file(seed, passwd, key_id, salt, enc_seed, opts):
seed_id = make_chksum_8(seed)

1755
scripts/pywallet.py Executable file

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,7 @@ from distutils.core import setup
setup(
name = 'mmgen',
version = '0.6.3',
version = '0.6.4',
author = 'Philemon',
author_email = 'mmgen-py@yandex.com',
url = 'https://github.com/mmgen/mmgen',
@ -51,6 +51,7 @@ setup(
])],
scripts=[
'scripts/bitcoind-walletunlock.py',
'scripts/pywallet.py',
'scripts/deinstall.sh'
]
)