mmgen-txcreate interface improvements
utils.py -> util.py rename
This commit is contained in:
parent
941b9360d8
commit
1c9b0f8816
29 changed files with 162 additions and 140 deletions
|
|
@ -27,7 +27,7 @@ import sys
|
|||
from mmgen.Opts import *
|
||||
import mmgen.config as g
|
||||
from mmgen.license import *
|
||||
from mmgen.utils import *
|
||||
from mmgen.util import *
|
||||
from mmgen.addr import *
|
||||
|
||||
invoked_as = sys.argv[0].split("-")[-1]
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ mmgen-addrimport: Import addresses into a bitcoind watching wallet.
|
|||
import sys
|
||||
from mmgen.Opts import *
|
||||
from mmgen.license import *
|
||||
from mmgen.utils import check_infile,confirm_or_exit,msg,msg_r,secs_to_hms,get_lines_from_file
|
||||
from mmgen.util import check_infile,confirm_or_exit,msg,msg_r,secs_to_hms,get_lines_from_file
|
||||
from mmgen.tx import connect_to_bitcoind,parse_addrs_file
|
||||
from mmgen.bitcoin import verify_addr
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ mmgen-passchg: Change a mmgen deterministic wallet's passphrase, label or
|
|||
|
||||
import sys
|
||||
from mmgen.Opts import *
|
||||
from mmgen.utils import *
|
||||
from mmgen.util import *
|
||||
import mmgen.config as g
|
||||
|
||||
help_data = {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ mmgen-pywallet: Dump contents of a bitcoind wallet to file
|
|||
# Ported from C code written by Laurent Haan (http://www.progressive-coding.com)
|
||||
|
||||
from mmgen.Opts import *
|
||||
from mmgen.utils import msg
|
||||
from mmgen.util import msg
|
||||
from bsddb.db import *
|
||||
import sys, time
|
||||
import json
|
||||
|
|
@ -92,7 +92,7 @@ long_opts = "help","outdir=","echo_passphrase","json","keys","addrs",\
|
|||
|
||||
opts,cmd_args = process_opts(sys.argv,help_data,short_opts,long_opts)
|
||||
|
||||
from mmgen.utils import check_infile
|
||||
from mmgen.util import check_infile
|
||||
|
||||
check_opts(opts,long_opts)
|
||||
|
||||
|
|
@ -1575,7 +1575,7 @@ def read_wallet(json_db, db_env, db_file, print_wallet, print_wallet_transaction
|
|||
|
||||
if password == None and \
|
||||
('json' in opts or 'keysforaddrs' in opts or 'keys' in opts):
|
||||
from mmgen.utils import get_bitcoind_passphrase
|
||||
from mmgen.util import get_bitcoind_passphrase
|
||||
password = get_bitcoind_passphrase("Enter password: ",opts)
|
||||
|
||||
if password != None:
|
||||
|
|
@ -1682,7 +1682,7 @@ elif 'addrs' in opts:
|
|||
ext,what = "addrs","addresses"
|
||||
|
||||
elif 'keysforaddrs' in opts:
|
||||
from mmgen.utils import get_lines_from_file
|
||||
from mmgen.util import get_lines_from_file
|
||||
usr_addrs = get_lines_from_file(opts['keysforaddrs'],"addresses")
|
||||
for addr in usr_addrs:
|
||||
try:
|
||||
|
|
@ -1696,7 +1696,7 @@ len_arg = "%s" % len(wallet_addrs) \
|
|||
if len(data) == len(wallet_addrs) or ext == "json" \
|
||||
else "%s:%s" % (len(data),len(wallet_addrs))
|
||||
|
||||
from mmgen.utils import make_chksum_8,write_walletdat_dump_to_file,write_to_stdout
|
||||
from mmgen.util import make_chksum_8,write_walletdat_dump_to_file,write_to_stdout
|
||||
wallet_id = make_chksum_8(str(sorted(wallet_addrs)))
|
||||
|
||||
data = "\n".join(data) + "\n"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from mmgen.Opts import *
|
|||
from mmgen.license import *
|
||||
import mmgen.config as g
|
||||
from mmgen.tx import *
|
||||
from mmgen.utils import msg, msg_r, user_confirm
|
||||
from mmgen.util import msg, msg_r, user_confirm
|
||||
from decimal import Decimal
|
||||
|
||||
prog_name = sys.argv[0].split("/")[-1]
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ from mmgen.Opts import *
|
|||
from mmgen.license import *
|
||||
import mmgen.config as g
|
||||
from mmgen.tx import *
|
||||
from mmgen.utils import msg,check_infile,get_lines_from_file,confirm_or_exit
|
||||
from mmgen.util import msg,check_infile,get_lines_from_file,confirm_or_exit
|
||||
|
||||
prog_name = sys.argv[0].split("/")[-1]
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ from mmgen.Opts import *
|
|||
from mmgen.license import *
|
||||
import mmgen.config as g
|
||||
from mmgen.tx import *
|
||||
from mmgen.utils import msg
|
||||
from mmgen.util import msg
|
||||
|
||||
help_data = {
|
||||
'prog_name': sys.argv[0].split("/")[-1],
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ mmgen-walletchk: Check integrity of a mmgen deterministic wallet, display
|
|||
import sys
|
||||
from mmgen.Opts import *
|
||||
|
||||
from mmgen.utils import *
|
||||
from mmgen.util import *
|
||||
|
||||
help_data = {
|
||||
'prog_name': sys.argv[0].split("/")[-1],
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from mmgen.Opts import *
|
|||
from mmgen.license import *
|
||||
import mmgen.config as g
|
||||
from mmgen.walletgen import *
|
||||
from mmgen.utils import *
|
||||
from mmgen.util import *
|
||||
prog_name = sys.argv[0].split("/")[-1]
|
||||
|
||||
help_data = {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
import sys, getopt
|
||||
import mmgen.config as g
|
||||
from mmgen.utils import msg
|
||||
from mmgen.util import msg
|
||||
|
||||
def usage(hd):
|
||||
print "USAGE: %s %s" % (hd['prog_name'], hd['usage'])
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ __all__ = [
|
|||
'mn_tirosh.py',
|
||||
'Opts.py',
|
||||
'tx.py',
|
||||
'utils.py',
|
||||
'util.py',
|
||||
'walletgen.py'
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ def write_addr_data_to_file(seed, data, addr_list, opts):
|
|||
else: ext = "akeys"
|
||||
|
||||
if 'b16' in opts: ext = ext.replace("keys","xkeys")
|
||||
from mmgen.utils import write_to_file, make_chksum_8, msg
|
||||
from mmgen.util import write_to_file, make_chksum_8, msg
|
||||
outfile = "{}[{}].{}".format(
|
||||
make_chksum_8(seed),
|
||||
fmt_addr_list(addr_list),
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ license.py: Show the license
|
|||
"""
|
||||
|
||||
import sys
|
||||
from mmgen.utils import msg, msg_r, get_char
|
||||
from mmgen.util import msg, msg_r, get_char
|
||||
|
||||
gpl = {
|
||||
'warning': """
|
||||
|
|
@ -591,7 +591,7 @@ def do_license_msg(immed=False):
|
|||
while True:
|
||||
reply = get_char(prompt, immed_chars="wc" if immed else "")
|
||||
if reply == 'w':
|
||||
from mmgen.utils import do_pager
|
||||
from mmgen.util import do_pager
|
||||
do_pager(gpl['conditions'])
|
||||
elif reply == 'c':
|
||||
msg(""); break
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ def mn_len(hexnum): return len(hexnum) * 3 / 8
|
|||
|
||||
import sys
|
||||
|
||||
from mmgen.utils import msg,make_chksum_8
|
||||
from mmgen.util import msg,make_chksum_8
|
||||
import mmgen.config as g
|
||||
|
||||
# These universal base-conversion routines work for any base
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class BitcoinConnection(object):
|
|||
return self.proxy.importaddress(address,label)
|
||||
except JSONRPCException as e:
|
||||
if e.error['message'] == "Method not found":
|
||||
from mmgen.utils import msg_r
|
||||
from mmgen.util import msg_r
|
||||
msg_r("""
|
||||
ERROR: 'importaddress' method not found. Is your bitcoind enabled for watch-only addresses?""")
|
||||
raise _wrap_exception(e.error)
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class AuthServiceProxy(object):
|
|||
'Authorization' : self.__authhdr,
|
||||
'Content-type' : 'application/json' })
|
||||
except:
|
||||
from mmgen.utils import msg
|
||||
from mmgen.util import msg
|
||||
import sys
|
||||
msg("\nUnable to connect to bitcoind.")
|
||||
sys.exit(2)
|
||||
|
|
|
|||
|
|
@ -2,17 +2,17 @@
|
|||
#
|
||||
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
|
||||
# Copyright (C) 2013 by philemon <mmgen-py@yandex.com>
|
||||
#
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
|
@ -2,17 +2,17 @@
|
|||
#
|
||||
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
|
||||
# Copyright (C) 2013 by philemon <mmgen-py@yandex.com>
|
||||
#
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
|
@ -20,7 +20,7 @@ bitcoin.py: Test suite for mmgen.bitcoin module
|
|||
"""
|
||||
|
||||
from mmgen.bitcoin import *
|
||||
from mmgen.utils import msg
|
||||
from mmgen.util import msg
|
||||
from test import *
|
||||
|
||||
import sys
|
||||
|
|
@ -2,17 +2,17 @@
|
|||
#
|
||||
# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
|
||||
# Copyright (C) 2013 by philemon <mmgen-py@yandex.com>
|
||||
#
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue