Browse Source

opts.py,cfg.py,globalvars.py: cleanups (minor)

The MMGen Project 3 years ago
parent
commit
5ca69146df
3 changed files with 14 additions and 15 deletions
  1. 3 3
      mmgen/cfg.py
  2. 2 2
      mmgen/globalvars.py
  3. 9 10
      mmgen/opts.py

+ 3 - 3
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

+ 2 - 2
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',

+ 9 - 10
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,
 		)
 }