whitespace, minor fixes

This commit is contained in:
The MMGen Project 2026-01-28 12:24:31 +00:00
commit e865170484
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 12 additions and 19 deletions

View file

@ -19,7 +19,7 @@ from subprocess import run, PIPE, DEVNULL
from .cfg import Config
from .util import msg, msg_r, ymsg, rmsg, gmsg, bmsg, die, suf, fmt, fmt_list, is_int, have_sudo, capfirst
from .color import yellow, red, orange, brown, blue
from .color import yellow, red, orange, brown, blue, gray
from .wallet import Wallet, get_wallet_cls
from .addrlist import AddrIdxList
from .filename import find_file_in_dir
@ -641,7 +641,7 @@ class Autosign:
redir = None if verbose else DEVNULL
if run(self.mount_cmd.split(), stderr=redir, stdout=redir).returncode == 0:
if not silent:
msg(f'Mounting ‘{self.mountpoint}')
msg(gray(f'Mounting ‘{self.mountpoint}'))
else:
die(1, f'Unable to mount device ‘{self.dev_label}’ at ‘{self.mountpoint}')
@ -652,7 +652,7 @@ class Autosign:
if self.mountpoint.is_mount():
run(['sync'], check=True)
if not silent:
msg(f'Unmounting ‘{self.mountpoint}')
msg(gray(f'Unmounting ‘{self.mountpoint}'))
redir = None if verbose else DEVNULL
run(self.umount_cmd.split(), stdout=redir, check=True)
if not silent:

View file

@ -217,8 +217,7 @@ class Config(Lockable):
columns = 0
color = bool(
(sys.stdout.isatty() and not os.getenv('MMGEN_TEST_SUITE_PEXPECT')) or
os.getenv('MMGEN_TEST_SUITE_ENABLE_COLOR')
)
os.getenv('MMGEN_TEST_SUITE_ENABLE_COLOR'))
# miscellaneous features:
use_internal_keccak_module = False
@ -280,9 +279,7 @@ class Config(Lockable):
_use_cfg_file = False
_use_env = False
_forbidden_opts = (
'data_dir_root',
)
_forbidden_opts = ('data_dir_root',)
_incompatible_opts = (
('help', 'longhelp'),
@ -290,8 +287,7 @@ class Config(Lockable):
('label', 'keep_label'),
('tx_id', 'info'),
('tx_id', 'terse_info'),
('autosign', 'outdir'),
)
('autosign', 'outdir'))
# proto-specific only: eth_mainnet_chain_names eth_testnet_chain_names
# coin-specific only: bch_cashaddr (alias of cashaddr)
@ -376,8 +372,7 @@ class Config(Lockable):
'MMGEN_IGNORE_DAEMON_VERSION',
'MMGEN_USE_STANDALONE_SCRYPT_MODULE',
'MMGEN_ENABLE_ERIGON',
'MMGEN_DISABLE_COLOR',
)
'MMGEN_DISABLE_COLOR')
_infile_opts = (
'keys_from_file',
@ -385,8 +380,7 @@ class Config(Lockable):
'passwd_file',
'keysforaddrs',
'comment_file',
'contract_data',
)
'contract_data')
# Auto-typechecked and auto-set opts - first value in list is the default
_ov = namedtuple('autoset_opt_info', ['type', 'choices'])

View file

@ -67,8 +67,7 @@ class MoneroRPCClient(RPCClient):
self.daemon_version_str = ver_str
self.daemon_version = sum(
int(m) * (1000 ** n) for n, m in
enumerate(reversed(re.match(r'(\d+)\.(\d+)\.(\d+)\.(\d+)', ver_str).groups()))
)
enumerate(reversed(re.match(r'(\d+)\.(\d+)\.(\d+)\.(\d+)', ver_str).groups())))
if self.daemon and self.daemon_version > self.daemon.coind_version:
self.handle_unsupported_daemon_version(
proto.name,
@ -82,8 +81,7 @@ class MoneroRPCClient(RPCClient):
return self.process_http_resp(self.backend.run_noasync(
payload = {'id': 0, 'jsonrpc': '2.0', 'method': method, 'params': kwargs},
timeout = 3600, # allow enough time to sync ≈1,000,000 blocks
host_path = '/json_rpc'
))
host_path = '/json_rpc'))
def call_raw(self, method, *params, **kwargs):
assert not params, f'{self.name}.call() accepts keyword arguments only'
@ -91,7 +89,7 @@ class MoneroRPCClient(RPCClient):
payload = kwargs,
timeout = self.timeout,
host_path = f'/{method}'
), json_rpc=False)
), json_rpc = False)
async def do_stop_daemon(self, *, silent=False):
return self.call_raw('stop_daemon') # unreliable on macOS (daemon stops, but closes connection)

View file

@ -124,6 +124,7 @@ def op(op, cfg, infile, wallets, *, spec=None, compat_call=False):
cfg = Config({
'_clone': cfg,
'compat': True,
'full_address': cfg.full_address or compat_call,
'xmrwallet_compat': True} | ({} if cfg.offline else {
'no_start_wallet_daemon': cfg.no_start_wallet_daemon or compat_call,
'daemon': cfg.daemon or cfg.monero_daemon,