From 5ca69146dff8297c2c2e09a27f309dda7f43cc1f Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 21 Jan 2022 11:23:44 +0000 Subject: [PATCH] opts.py,cfg.py,globalvars.py: cleanups (minor) --- mmgen/cfg.py | 6 +++--- mmgen/globalvars.py | 4 ++-- mmgen/opts.py | 19 +++++++++---------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/mmgen/cfg.py b/mmgen/cfg.py index 0a9e844e..1c8e7e57 100755 --- a/mmgen/cfg.py +++ b/mmgen/cfg.py @@ -20,9 +20,9 @@ cfg.py: API for the MMGen runtime configuration file and related files """ -# NB: This module is used by override_from_cfg_file(), which is called before override_from_env() -# during init, so global config vars that are set from the environment (such as g.test_suite) -# cannot be used here. +# NB: This module is used by override_globals_from_cfg_file(), which is called before +# override_from_env() during init, so global config vars that are set from the environment +# (such as g.test_suite) cannot be used here. import sys,os,re,hashlib from collections import namedtuple diff --git a/mmgen/globalvars.py b/mmgen/globalvars.py index 97572155..f39ae1eb 100755 --- a/mmgen/globalvars.py +++ b/mmgen/globalvars.py @@ -146,7 +146,7 @@ class GlobalContext(Lockable): else: die(2,'$HOME is not set! Unable to determine home directory') - data_dir_root,data_dir,cfg_file = None,None,None + data_dir_root,data_dir,cfg_file = (None,None,None) daemon_data_dir = '' # set by user daemon_id = '' @@ -163,7 +163,7 @@ class GlobalContext(Lockable): # user opt sets global var: opt_sets_global = ( 'cached_balances', ) - # 'long' opts - opt sets global var (see common_opts_data) + # 'long' opt sets global var (subset of common_opts_data): common_opts = ( 'accept_defaults', 'aiohttp_rpc_queue_len', diff --git a/mmgen/opts.py b/mmgen/opts.py index d8f3f2d4..88c33cce 100755 --- a/mmgen/opts.py +++ b/mmgen/opts.py @@ -184,30 +184,29 @@ common_opts_data = { --, --accept-defaults Accept defaults at all prompts --, --coin=c Choose coin unit. Default: BTC. Current choice: {cu_dfl} --, --token=t Specify an ERC20 token by address or symbol ---, --color=0|1 Disable or enable color output +--, --color=0|1 Disable or enable color output (enabled by default) --, --force-256-color Force 256-color output when color is enabled --, --data-dir=path Specify {pnm} data directory location ---, --daemon-data-dir=path Specify {dn} data directory location +--, --daemon-data-dir=path Specify coin daemon data directory location --, --daemon-id=ID Specify the coin daemon ID ---, --ignore-daemon-version Ignore {dn} version check +--, --ignore-daemon-version Ignore coin daemon version check --, --http-timeout=t Set HTTP timeout in seconds for JSON-RPC connections --, --no-license Suppress the GPL license prompt ---, --rpc-host=host Communicate with {dn} running on host 'host' ---, --rpc-port=port Communicate with {dn} listening on port 'port' ---, --rpc-user=user Authenticate to {dn} using username 'user' ---, --rpc-password=pass Authenticate to {dn} using password 'pass' +--, --rpc-host=host Communicate with coin daemon running on host 'host' +--, --rpc-port=port Communicate with coin daemon listening on port 'port' +--, --rpc-user=user Authenticate to coin daemon using username 'user' +--, --rpc-password=pass Authenticate to coin daemon using password 'pass' --, --rpc-backend=backend Use backend 'backend' for JSON-RPC communications --, --aiohttp-rpc-queue-len=N Use 'N' simultaneous RPC connections with aiohttp --, --regtest=0|1 Disable or enable regtest mode --, --testnet=0|1 Disable or enable testnet --, --skip-cfg-file Skip reading the configuration file --, --version Print version information and exit ---, --bob Switch to user "Bob" in MMGen regtest setup ---, --alice Switch to user "Alice" in MMGen regtest setup +--, --bob Specify user "Bob" in MMGen regtest mode +--, --alice Specify user "Alice" in MMGen regtest mode """, 'code': lambda help_notes,proto,s: s.format( pnm = g.proj_name, - dn = help_notes('coind_exec'), cu_dfl = proto.coin, ) }