minor fixes, cleanups
This commit is contained in:
parent
7d84165ae7
commit
753bd0aba8
3 changed files with 14 additions and 12 deletions
|
|
@ -55,7 +55,7 @@ class Filename(MMGenObject):
|
||||||
ftype = from_extension.ext_to_type(self.ext)
|
ftype = from_extension.ext_to_type(self.ext)
|
||||||
if not ftype:
|
if not ftype:
|
||||||
from .exception import BadFileExtension
|
from .exception import BadFileExtension
|
||||||
raise BadFileExtension(f'{self.ext!r}: not a recognized file extension for {self.from_extension}')
|
raise BadFileExtension(f'{self.ext!r}: not a recognized file extension for {from_extension}')
|
||||||
|
|
||||||
self.ftype = ftype
|
self.ftype = ftype
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -220,12 +220,12 @@ common_opts_data = {
|
||||||
--, --ignore-daemon-version Ignore coin daemon version check
|
--, --ignore-daemon-version Ignore coin daemon version check
|
||||||
--, --http-timeout=t Set HTTP timeout in seconds for JSON-RPC connections
|
--, --http-timeout=t Set HTTP timeout in seconds for JSON-RPC connections
|
||||||
--, --no-license Suppress the GPL license prompt
|
--, --no-license Suppress the GPL license prompt
|
||||||
--, --rpc-host=host Communicate with coin daemon running on host 'host'
|
--, --rpc-host=HOST Communicate with coin daemon running on host HOST
|
||||||
--, --rpc-port=port Communicate with coin daemon listening on port 'port'
|
--, --rpc-port=PORT Communicate with coin daemon listening on port PORT
|
||||||
--, --rpc-user=user Authenticate to coin daemon using username 'user'
|
--, --rpc-user=USER Authenticate to coin daemon using username USER
|
||||||
--, --rpc-password=pass Authenticate to coin daemon using password 'pass'
|
--, --rpc-password=PASS Authenticate to coin daemon using password PASS
|
||||||
--, --rpc-backend=backend Use backend 'backend' for JSON-RPC communications
|
--, --rpc-backend=backend Use backend 'backend' for JSON-RPC communications
|
||||||
--, --aiohttp-rpc-queue-len=N Use 'N' simultaneous RPC connections with aiohttp
|
--, --aiohttp-rpc-queue-len=N Use N simultaneous RPC connections with aiohttp
|
||||||
--, --regtest=0|1 Disable or enable regtest mode
|
--, --regtest=0|1 Disable or enable regtest mode
|
||||||
--, --testnet=0|1 Disable or enable testnet
|
--, --testnet=0|1 Disable or enable testnet
|
||||||
--, --skip-cfg-file Skip reading the configuration file
|
--, --skip-cfg-file Skip reading the configuration file
|
||||||
|
|
@ -281,10 +281,6 @@ def init(opts_data=None,add_opts=None,init_opts=None,opt_filter=None,parse_only=
|
||||||
+ g.common_opts ):
|
+ g.common_opts ):
|
||||||
setattr(opt,o,po.user_opts[o] if o in po.user_opts else None)
|
setattr(opt,o,po.user_opts[o] if o in po.user_opts else None)
|
||||||
|
|
||||||
# Make this available to usage()
|
|
||||||
global usage_data
|
|
||||||
usage_data = opts_data['text'].get('usage2') or opts_data['text']['usage']
|
|
||||||
|
|
||||||
if opt.version:
|
if opt.version:
|
||||||
version() # exits
|
version() # exits
|
||||||
|
|
||||||
|
|
@ -374,6 +370,10 @@ def init(opts_data=None,add_opts=None,init_opts=None,opt_filter=None,parse_only=
|
||||||
if getattr(opt,'help',None) or getattr(opt,'longhelp',None):
|
if getattr(opt,'help',None) or getattr(opt,'longhelp',None):
|
||||||
print_help(po,opts_data,opt_filter) # exits
|
print_help(po,opts_data,opt_filter) # exits
|
||||||
|
|
||||||
|
del mmgen.share.Opts.print_help
|
||||||
|
del mmgen.share.Opts.process_uopts
|
||||||
|
del mmgen.share.Opts.parse_opts
|
||||||
|
|
||||||
from .util import warn_altcoins
|
from .util import warn_altcoins
|
||||||
warn_altcoins(g.coin,altcoin_trust_level)
|
warn_altcoins(g.coin,altcoin_trust_level)
|
||||||
|
|
||||||
|
|
@ -398,8 +398,11 @@ def init(opts_data=None,add_opts=None,init_opts=None,opt_filter=None,parse_only=
|
||||||
if g.debug_opts:
|
if g.debug_opts:
|
||||||
opt_postproc_debug()
|
opt_postproc_debug()
|
||||||
|
|
||||||
|
# Make this available to usage()
|
||||||
|
global usage_data
|
||||||
|
usage_data = opts_data['text'].get('usage2') or opts_data['text']['usage']
|
||||||
|
|
||||||
# We don't need this data anymore
|
# We don't need this data anymore
|
||||||
del mmgen.share.Opts
|
|
||||||
for k in ('text','notes','code'):
|
for k in ('text','notes','code'):
|
||||||
if k in opts_data:
|
if k in opts_data:
|
||||||
del opts_data[k]
|
del opts_data[k]
|
||||||
|
|
|
||||||
|
|
@ -1053,7 +1053,6 @@ class tool_api(
|
||||||
"""
|
"""
|
||||||
Initializer - takes no arguments
|
Initializer - takes no arguments
|
||||||
"""
|
"""
|
||||||
import mmgen.opts
|
|
||||||
opts.UserOpts._reset_ok += ('usr_randchars',)
|
opts.UserOpts._reset_ok += ('usr_randchars',)
|
||||||
if not opt._lock:
|
if not opt._lock:
|
||||||
opts.init()
|
opts.init()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue