From 6ef0aef487c9708336a1e261a1d5de663463b9dd Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 3 Oct 2025 10:34:04 +0000 Subject: [PATCH] whitespace, minor cleanups (5 files) --- mmgen/fileutil.py | 2 +- mmgen/main_tool.py | 3 +-- mmgen/platform/darwin/util.py | 5 ++++- mmgen/rpc/local.py | 3 +-- test/modtest_d/rune.py | 5 +++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mmgen/fileutil.py b/mmgen/fileutil.py index 2dff65fb..cf09f78b 100755 --- a/mmgen/fileutil.py +++ b/mmgen/fileutil.py @@ -64,7 +64,7 @@ def shred_file(cfg, fn, *, iterations=30): ['shred', '--force', f'--iterations={iterations}', '--zero', '--remove=wipesync'] + (['--verbose'] if cfg.verbose else []) + [str(fn)], - check=True) + check = True) set_vt100() def _check_file_type_and_access(fname, ftype, *, blkdev_ok=False): diff --git a/mmgen/main_tool.py b/mmgen/main_tool.py index c9f9cad5..aae54e69 100755 --- a/mmgen/main_tool.py +++ b/mmgen/main_tool.py @@ -392,9 +392,8 @@ if gc.prog_name.endswith('-tool'): args, kwargs = process_args(cmd, args, cls) func = getattr(cls(cfg, cmdname=cmd), cmd) - ret = async_run(cfg, func, args=args, kwargs=kwargs) if isAsync(func) else func(*args, **kwargs) process_result( - ret, + async_run(cfg, func, args=args, kwargs=kwargs) if isAsync(func) else func(*args, **kwargs), pager = kwargs.get('pager'), print_result = True) diff --git a/mmgen/platform/darwin/util.py b/mmgen/platform/darwin/util.py index abadc953..4365fa21 100755 --- a/mmgen/platform/darwin/util.py +++ b/mmgen/platform/darwin/util.py @@ -70,7 +70,10 @@ class MacOSRamDisk: self.cfg._util.qmsg(f'{self.desc.capitalize()} {self.label.hl()} at path {self.path} already exists') return self.cfg._util.qmsg(f'Creating {self.desc} {self.label.hl()} of size {self.size}MB') - cp = run(['hdiutil', 'attach', '-nomount', f'ram://{2048 * self.size}'], stdout=PIPE, check=True) + cp = run( + ['hdiutil', 'attach', '-nomount', f'ram://{2048 * self.size}'], + stdout = PIPE, + check = True) self.dev_name = cp.stdout.decode().strip() self.cfg._util.qmsg(f'Created {self.desc} {self.label.hl()} [{self.dev_name}]') run(['diskutil', 'eraseVolume', 'APFS', self.label, self.dev_name], stdout=redir, check=True) diff --git a/mmgen/rpc/local.py b/mmgen/rpc/local.py index c80db98e..6f840438 100755 --- a/mmgen/rpc/local.py +++ b/mmgen/rpc/local.py @@ -83,8 +83,7 @@ class RPCClient: return self.process_http_resp(await self.backend.run( payload = {'id': 1, 'jsonrpc': '2.0', 'method': method, 'params': params}, timeout = timeout, - host_path = self.make_host_path(wallet) - )) + host_path = self.make_host_path(wallet))) async def batch_call(self, method, param_list, *, timeout=None, wallet=None): """ diff --git a/test/modtest_d/rune.py b/test/modtest_d/rune.py index 33b1d5b2..5ad5d58d 100755 --- a/test/modtest_d/rune.py +++ b/test/modtest_d/rune.py @@ -17,7 +17,7 @@ from mmgen.proto.rune.tx.protobuf import ( deposit_tx_parms, swap_tx_parms) -from ..include.common import vmsg, silence, end_silence +from ..include.common import vmsg, qmsg, silence, end_silence test_cfg = Config({'coin': 'rune', 'test_suite': True}) @@ -171,7 +171,8 @@ def test_tx(src, cfg, vec): if tx.txid not in (vec.txid, vec_txid2): raise ValueError(f'{tx.txid} not in ({vec.txid}, {vec_txid2})') if tx.txid == vec_txid2: - ymsg('\nWarning: non-standard TxID produced') + qmsg('') + ymsg('Warning: non-standard TxID produced') if src == 'parse' and parms.from_addr: built_tx = build_tx(cfg, proto, parms, null_fee=vec.null_fee)