From 22caf408216c5923e6414ca4c3c940eea56dfb5d Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Fri, 18 Oct 2024 10:32:06 +0000 Subject: [PATCH] whitespace, minor changes --- mmgen/help/xmrwallet.py | 12 +++++------ mmgen/main_xmrwallet.py | 44 +++++++++++++++++------------------------ 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/mmgen/help/xmrwallet.py b/mmgen/help/xmrwallet.py index 11e1a08f..205720f8 100755 --- a/mmgen/help/xmrwallet.py +++ b/mmgen/help/xmrwallet.py @@ -12,8 +12,8 @@ help.xmrwallet: xmrwallet help notes for MMGen suite """ -def help(proto,cfg): - from ..xmrwallet import xmrwallet_uarg_info as uai +def help(proto, cfg): + from ..xmrwallet import xmrwallet_uarg_info as uarg_info return """ Many operations take an optional ‘wallets’ argument: one or more address @@ -460,8 +460,8 @@ Once you’ve gained proficiency with the autosigning process and feel ready to delete your old hot wallets, make sure to do so securely using ‘shred’, ‘wipe’ or some other secure deletion utility. """.strip().format( - newaddr_spec = uai['newaddr_spec'].annot, - label_spec = uai['label_spec'].annot, - transfer_spec = uai['transfer_spec'].annot, - sweep_spec = uai['sweep_spec'].annot, + newaddr_spec = uarg_info['newaddr_spec'].annot, + label_spec = uarg_info['label_spec'].annot, + transfer_spec = uarg_info['transfer_spec'].annot, + sweep_spec = uarg_info['sweep_spec'].annot, ) diff --git a/mmgen/main_xmrwallet.py b/mmgen/main_xmrwallet.py index 202236e3..48ba4f84 100755 --- a/mmgen/main_xmrwallet.py +++ b/mmgen/main_xmrwallet.py @@ -2,19 +2,11 @@ # # MMGen Wallet, a terminal-based cryptocurrency wallet # Copyright (C)2013-2024 The MMGen Project -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Licensed under the GNU General Public License, Version 3: +# https://www.gnu.org/licenses +# Public project repositories: +# https://github.com/mmgen/mmgen-wallet +# https://gitlab.com/mmgen/mmgen-wallet """ mmgen-xmrwallet: Perform various Monero wallet and transacting operations for @@ -22,8 +14,8 @@ mmgen-xmrwallet: Perform various Monero wallet and transacting operations for """ import asyncio -from .cfg import gc,Config -from .util import die,fmt_dict +from .cfg import gc, Config +from .util import die, fmt_dict from .xmrwallet import ( MoneroWalletOps, xmrwallet_uarg_info, @@ -33,9 +25,9 @@ from .xmrwallet import ( opts_data = { 'sets': [ - ('autosign',True,'watch_only',True), - ('autosign_mountpoint',bool,'autosign',True), - ('autosign_mountpoint',bool,'watch_only',True), + ('autosign', True, 'watch_only', True), + ('autosign_mountpoint', bool, 'autosign', True), + ('autosign_mountpoint', bool, 'watch_only', True), ], 'text': { 'desc': """Perform various Monero wallet and transacting operations for @@ -101,14 +93,14 @@ opts_data = { """ }, 'code': { - 'options': lambda cfg,s: s.format( + 'options': lambda cfg, s: s.format( D=xmrwallet_uarg_info['daemon'].annot, R=xmrwallet_uarg_info['tx_relay_daemon'].annot, cfg=cfg, gc=gc, tp=fmt_dict(tx_priorities,fmt='equal_compact') ), - 'notes': lambda help_mod,s: s.format( + 'notes': lambda help_mod, s: s.format( xmrwallet_help = help_mod('xmrwallet') ) } @@ -125,7 +117,7 @@ if cmd_args and cfg.autosign and ( ) or len(cmd_args) == 1 and cmd_args[0] in ('submit', 'resubmit', 'abort') ): - cmd_args.insert(1,None) + cmd_args.insert(1, None) if len(cmd_args) < 2: cfg._usage() @@ -137,9 +129,9 @@ wallets = spec = None if op in ('relay', 'submit', 'resubmit', 'abort'): if len(cmd_args) != 0: cfg._usage() -elif op in ('txview','txlist'): +elif op in ('txview', 'txlist'): infile = [infile] + cmd_args -elif op in ('create','sync','list','view','listview','dump','restore'): # kafile_arg_ops +elif op in ('create', 'sync', 'list', 'view', 'listview', 'dump', 'restore'): # kafile_arg_ops if len(cmd_args) > 1: cfg._usage() wallets = cmd_args.pop(0) if cmd_args else None @@ -148,13 +140,13 @@ elif op in ('new', 'transfer', 'sweep', 'sweep_all', 'label'): cfg._usage() spec = cmd_args[0] elif op in ('export-outputs', 'export-outputs-sign', 'import-key-images'): - if not cfg.autosign: # --autosign only for now - TODO - die(f'--autosign must be used with command {op!r}') + if not cfg.autosign: + die(1, f'--autosign must be used with command {op!r}') if len(cmd_args) > 1: cfg._usage() wallets = cmd_args.pop(0) if cmd_args else None else: - die(1,f'{op!r}: unrecognized operation') + die(1, f'{op!r}: unrecognized operation') op_cls = getattr(MoneroWalletOps,op.replace('-','_'))