From d87e67406abdd03bf3ae4de0043db24cf35dab4e Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 20 Oct 2026 17:38:43 +0000 Subject: [PATCH] whitespace (hanging parentheses) --- mmgen/led.py | 3 +-- mmgen/mn_entry.py | 6 ++---- mmgen/msg.py | 3 +-- mmgen/opts.py | 3 +-- mmgen/proto/btc/tw/txhistory.py | 3 +-- mmgen/proto/eth/rpc/local.py | 7 +++---- mmgen/subseed.py | 6 ++---- mmgen/tool/api.py | 3 +-- mmgen/tool/coin.py | 3 +-- mmgen/tw/ctl.py | 3 +-- mmgen/wallet/base.py | 3 +-- mmgen/wallet/unenc.py | 3 +-- mmgen/xmrwallet/ops/sync.py | 3 +-- test/cmdtest_d/include/runner.py | 3 +-- test/cmdtest_d/main.py | 3 +-- test/include/common.py | 3 +-- test/include/unit_test.py | 6 ++---- test/misc/cfg_main.py | 3 +-- test/misc/input_func.py | 3 +-- test/misc/term.py | 4 ++-- test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py | 3 +-- test/tooltest2.py | 3 +-- 22 files changed, 28 insertions(+), 52 deletions(-) diff --git a/mmgen/led.py b/mmgen/led.py index 3e6efe1a..3e8e78fb 100644 --- a/mmgen/led.py +++ b/mmgen/led.py @@ -125,8 +125,7 @@ class LEDControl: msg('\n{}\n{}\n{}'.format( blue(f'You do not have write access to the {desc}'), blue(f'To allow access, run the following command:\n\n {cmd}'), - orange('[To prevent this message in the future, enable sudo without a password]') - )) + orange('[To prevent this message in the future, enable sudo without a password]'))) sys.exit(1) def init_state(fn, *, desc, init_val=None): diff --git a/mmgen/mn_entry.py b/mmgen/mn_entry.py index a2be6e0e..c9adb4e5 100644 --- a/mmgen/mn_entry.py +++ b/mmgen/mn_entry.py @@ -303,8 +303,7 @@ class MnemonicEntry: msg(' {}) {:8} {}'.format( n, mode.name + ':', - fmt(mode.choose_info, indent=' '*14).lstrip().format(usl=self.uniq_ss_len), - )) + fmt(mode.choose_info, indent=' '*14).lstrip().format(usl=self.uniq_ss_len))) prompt = f'Type a number, or hit ENTER for the default ({capfirst(self.dfl_entry_mode)}): ' erase = '\r' + ' ' * (len(prompt)+19) + '\r' while True: @@ -343,8 +342,7 @@ class MnemonicEntry: ml = mn_len, ssl = em.ss_len, pad_max = em.pad_max, - sw = self.shortest_word, - )) + sw = self.shortest_word)) clear_line = '\n' if self.cfg.test_suite else '{r}{s}{r}'.format(r='\r', s=' '*40) idx, idxs = 1, [] # initialize idx to a non-None value diff --git a/mmgen/msg.py b/mmgen/msg.py index 8e1705ef..0b352ac1 100644 --- a/mmgen/msg.py +++ b/mmgen/msg.py @@ -67,8 +67,7 @@ class coin_msg: json.dumps( {k: self.data[k] for k in self.chksum_keys}, sort_keys = True, - separators = (',', ':') - )) + separators = (',', ':'))) @property def filename_stem(self): diff --git a/mmgen/opts.py b/mmgen/opts.py index ee557c0c..1da07702 100644 --- a/mmgen/opts.py +++ b/mmgen/opts.py @@ -391,7 +391,6 @@ class UserOpts(Opts): cmd = ( ['-'] + (['r'] if caps.rpc else []) - + (['p', 'c'] if caps.proto and caps.use_coin_opt else ['p'] if caps.proto else []) - )) + + (['p', 'c'] if caps.proto and caps.use_coin_opt else ['p'] if caps.proto else []))) else: # unmanaged command: enable everything return ret(None, None) diff --git a/mmgen/proto/btc/tw/txhistory.py b/mmgen/proto/btc/tw/txhistory.py index eccc3ff8..9ff29141 100644 --- a/mmgen/proto/btc/tw/txhistory.py +++ b/mmgen/proto/btc/tw/txhistory.py @@ -76,8 +76,7 @@ class BitcoinTwTransaction: (d.twlabel.twmmid.sort_key if d.twlabel and d.twlabel.twmmid.type == 'mmgen' else '') + '_' + d.txid - + '{:08d}'.format(d.data['n']) - )) + + '{:08d}'.format(d.data['n']))) def gen_all_addrs(src): for e in self.vouts_info[src]: diff --git a/mmgen/proto/eth/rpc/local.py b/mmgen/proto/eth/rpc/local.py index 8be8656c..d5224356 100644 --- a/mmgen/proto/eth/rpc/local.py +++ b/mmgen/proto/eth/rpc/local.py @@ -53,10 +53,9 @@ class EthereumRPCClient(RPCClient, metaclass=AsyncInit): await self.set_backend_async(backend) vi, bh, ci = await self.gathered_call(None, ( - ('web3_clientVersion', ()), - ('eth_getBlockByNumber', ('latest', False)), - ('eth_chainId', ()), - )) + ('web3_clientVersion', ()), + ('eth_getBlockByNumber', ('latest', False)), + ('eth_chainId', ()))) vip = re.match(self.daemon.version_pat, vi, re.ASCII) if not vip: diff --git a/mmgen/subseed.py b/mmgen/subseed.py index 4d14b2ba..0b48f9c5 100644 --- a/mmgen/subseed.py +++ b/mmgen/subseed.py @@ -99,8 +99,7 @@ class SubSeedList(MMGenObject): msg_r('{} {} of {}...'.format( green('Generating subseed'), ss_idx.hl(), - self.parent_seed.sid.hl(), - )) + self.parent_seed.sid.hl())) if ss_idx.idx > len(self): self._generate(ss_idx.idx) @@ -134,8 +133,7 @@ class SubSeedList(MMGenObject): green('Found subseed'), subseed.sid.hl(), self.parent_seed.sid.hl(), - subseed.ss_idx.hl(), - )) + subseed.ss_idx.hl())) if last_idx is None: last_idx = self.len diff --git a/mmgen/tool/api.py b/mmgen/tool/api.py index 84e030ed..21ae1244 100644 --- a/mmgen/tool/api.py +++ b/mmgen/tool/api.py @@ -92,8 +92,7 @@ class tool_api( from ..altcoin.params import CoinInfo return sorted(set( [c.upper() for c in CoinProtocol.coins] - + [c.symbol for c in CoinInfo.get_supported_coins(self.proto.network)] - )) + + [c.symbol for c in CoinInfo.get_supported_coins(self.proto.network)])) @property def coin(self): diff --git a/mmgen/tool/coin.py b/mmgen/tool/coin.py index ea998c64..1a91fe9f 100644 --- a/mmgen/tool/coin.py +++ b/mmgen/tool/coin.py @@ -142,8 +142,7 @@ class tool_cmd(tool_cmd_base): pubkey = bytes.fromhex(pubkeyhex), viewkey_bytes = None, pubkey_type = self.mmtype.pubkey_type, - compressed = self.mmtype.compressed, - )) + compressed = self.mmtype.compressed)) def pubhex2redeem_script(self, pubkeyhex: fstr): # new "convert a hexadecimal pubkey to a Segwit P2SH-P2WPKH redeem script" diff --git a/mmgen/tw/ctl.py b/mmgen/tw/ctl.py index ca5ec852..055f0337 100644 --- a/mmgen/tw/ctl.py +++ b/mmgen/tw/ctl.py @@ -37,8 +37,7 @@ def write_mode(orig_func): if self.mode != 'w': die(1, '{} opened in read-only mode: cannot execute method {}()'.format( type(self).__name__, - locals()['orig_func'].__name__ - )) + locals()['orig_func'].__name__)) return orig_func(self, *args, **kwargs) return f diff --git a/mmgen/wallet/base.py b/mmgen/wallet/base.py index acd3a3cf..4cc22d96 100644 --- a/mmgen/wallet/base.py +++ b/mmgen/wallet/base.py @@ -68,8 +68,7 @@ class wallet(MMGenObject, metaclass=WalletMeta): b = self.seed.sid.hl(), c = f' (seed length {self.seed.bitlen})' if self.seed.bitlen != 256 else '', d = '' if not hasattr(self, 'mnemonic') or self.mnemonic.has_chksum else - orange(' [mnemonic format has no checksum]') - )) + orange(' [mnemonic format has no checksum]'))) def _get_data(self): if hasattr(self, 'infile'): diff --git a/mmgen/wallet/unenc.py b/mmgen/wallet/unenc.py index ead3b176..f3f2fa28 100644 --- a/mmgen/wallet/unenc.py +++ b/mmgen/wallet/unenc.py @@ -30,8 +30,7 @@ class wallet(wallet): def _print_seed_type(self): msg('{} {}'.format( blue(f'{capfirst(self.base_type or self.type)} type:'), - yellow(self.mn_type) - )) + yellow(self.mn_type))) def _choose_seedlen(self, ok_lens): diff --git a/mmgen/xmrwallet/ops/sync.py b/mmgen/xmrwallet/ops/sync.py index 57f33e2a..66b2d0f0 100644 --- a/mmgen/xmrwallet/ops/sync.py +++ b/mmgen/xmrwallet/ops/sync.py @@ -86,8 +86,7 @@ class OpSync(OpWallet): from . import hl_amt msg(' Balance: {} Unlocked balance: {}'.format( hl_amt(wd.accts_data['total_balance']), - hl_amt(wd.accts_data['total_unlocked_balance']), - )) + hl_amt(wd.accts_data['total_unlocked_balance']))) self.wallets_data[fn.name] = wd diff --git a/test/cmdtest_d/include/runner.py b/test/cmdtest_d/include/runner.py index ae44dadb..d9aae74f 100644 --- a/test/cmdtest_d/include/runner.py +++ b/test/cmdtest_d/include/runner.py @@ -233,8 +233,7 @@ class CmdTestRunner: t = int(time.time() - self.start_time) sys.stderr.write(green( f'{self.cmd_total} test{suf(self.cmd_total)} performed' + - ('\n' if self.cfg.no_timings else f'. Elapsed time: {t//60:02d}:{t%60:02d}\n') - )) + ('\n' if self.cfg.no_timings else f'. Elapsed time: {t//60:02d}:{t%60:02d}\n'))) def init_group(self, gname, sg_name=None, cmd=None, quiet=False, do_clean=True): diff --git a/test/cmdtest_d/main.py b/test/cmdtest_d/main.py index d498a56c..b2e430e3 100644 --- a/test/cmdtest_d/main.py +++ b/test/cmdtest_d/main.py @@ -864,8 +864,7 @@ class CmdTestMain(CmdTestBase, CmdTestShared): wcls = get_wallet_cls(fmt_code=out_fmt) msg('==> {}: {}'.format( wcls.desc, - cyan(get_data_from_file(self.cfg, f, desc=wcls.desc)) - )) + cyan(get_data_from_file(self.cfg, f, desc=wcls.desc)))) end_silence() return t diff --git a/test/include/common.py b/test/include/common.py index e9913423..c94435de 100644 --- a/test/include/common.py +++ b/test/include/common.py @@ -289,8 +289,7 @@ def oqmsg_r(s): def end_msg(t): omsg(green( 'All requested tests finished OK' + - ('' if cfg.test_suite_deterministic else f', elapsed time: {t//60:02d}:{t%60:02d}') - )) + ('' if cfg.test_suite_deterministic else f', elapsed time: {t//60:02d}:{t%60:02d}'))) def start_test_daemons(*network_ids, remove_datadir=False, verbose=False): if not cfg.no_daemon_autostart: diff --git a/test/include/unit_test.py b/test/include/unit_test.py index b71dcbc2..e2b496e5 100644 --- a/test/include/unit_test.py +++ b/test/include/unit_test.py @@ -129,8 +129,7 @@ class UnitTestHelpers: def skip_msg(self, desc): cfg._util.qmsg(gray( - f'Skipping {test_type} subtest {self.subtest_name.replace("_", "-")!r} for {desc}' - )) + f'Skipping {test_type} subtest {self.subtest_name.replace("_", "-")!r} for {desc}')) def process_bad_data(self, data, pfx='bad '): if os.getenv('PYTHONOPTIMIZE'): @@ -226,8 +225,7 @@ def run_test(test, subtest=None): def subtest_skip_msg(name, add_msg): cfg._util.qmsg(gray( - 'Skipping {} subtest {!r} {}'.format(test_type, name.replace('_', '-'), add_msg) - )) + 'Skipping {} subtest {!r} {}'.format(test_type, name.replace('_', '-'), add_msg))) for _subtest in subtests: if cfg.no_altcoin_deps and _subtest in altcoin_deps: diff --git a/test/misc/cfg_main.py b/test/misc/cfg_main.py index bfc5b8ce..a8f19356 100755 --- a/test/misc/cfg_main.py +++ b/test/misc/cfg_main.py @@ -50,8 +50,7 @@ match op: cfg._proto.coin.lower(), type(cfg._proto).__name__, varname, - getattr(cfg._proto, varname) - )) + getattr(cfg._proto, varname))) case 'autoset_opts': assert cfg.rpc_backend == 'aiohttp', "cfg.rpc_backend != 'aiohttp'" case 'autoset_opts_cmdline': diff --git a/test/misc/input_func.py b/test/misc/input_func.py index 51ff8797..7ab0b832 100755 --- a/test/misc/input_func.py +++ b/test/misc/input_func.py @@ -36,7 +36,6 @@ match cfg._args: func_args.update({'cfg':cfg}) msg(' Calling {name}({args})'.format( name = cmd, - args = ', '.join(f'{k}={v!r}' for k, v in func_args.items()) - )) + args = ', '.join(f'{k}={v!r}' for k, v in func_args.items()))) ret = locals()[cmd](**func_args) msg(f' ==> {ret!r}') diff --git a/test/misc/term.py b/test/misc/term.py index 81a0173b..232db853 100755 --- a/test/misc/term.py +++ b/test/misc/term.py @@ -133,8 +133,8 @@ def _tt_get_char(raw=False, one_char=False, immed_chars=''): cmsg('Testing {}({}):'.format( funcname, - ','.join(f'{a}={b!r}' for a, b in kwargs.items()) - )) + ','.join(f'{a}={b!r}' for a, b in kwargs.items()))) + msg(fs.format(m1, yellow(m2), yellow(m3))) try: diff --git a/test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py b/test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py index 5e153c3f..75211a9f 100644 --- a/test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py +++ b/test/overlay/fakemods/mmgen/proto/btc/tw/unspent.py @@ -10,7 +10,6 @@ if overlay_fake_os.getenv('MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA'): from ....fileutil import get_data_from_file return json.loads(get_data_from_file( self.cfg, - overlay_fake_os.getenv('MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA') - )) + overlay_fake_os.getenv('MMGEN_TEST_SUITE_BOGUS_UNSPENT_DATA'))) BitcoinTwUnspentOutputs.get_rpc_data = overlay_fake_BitcoinTwUnspentOutputs.get_rpc_data diff --git a/test/tooltest2.py b/test/tooltest2.py index 4ed77479..6c432eb5 100755 --- a/test/tooltest2.py +++ b/test/tooltest2.py @@ -273,8 +273,7 @@ def do_group(gid): cls = main_tool.get_mod_cls(gid.lower()) qmsg(blue('Testing ' + desc if cfg.names else - (docstring_head(cls) or desc) - )) + (docstring_head(cls) or desc))) for cmdname in cls(cfg).user_commands: if cmdname in skipped_tests: