From 3c015fa34fef1195cb16034c0ca0af787c77ba49 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 5 Feb 2022 13:32:53 +0000 Subject: [PATCH] minor fixes and cleanups --- mmgen/main_tool.py | 1 + mmgen/tool/common.py | 4 +++- mmgen/tool/file.py | 1 + mmgen/wallet.py | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mmgen/main_tool.py b/mmgen/main_tool.py index f4b47d28..02b8cfa1 100755 --- a/mmgen/main_tool.py +++ b/mmgen/main_tool.py @@ -229,6 +229,7 @@ def process_args(cmd,cmd_args,cls): u_nkwargs = len(cmd_args) - len(c_args) u_kwargs = {} if flag == 'VAR_ARGS': + cmd_args = ['dummy_arg'] + cmd_args t = [a.split('=',1) for a in cmd_args if '=' in a] tk = [a[0] for a in t] tk_bad = [a for a in tk if a not in c_kwargs] diff --git a/mmgen/tool/common.py b/mmgen/tool/common.py index 9f2d38d0..9027eb12 100755 --- a/mmgen/tool/common.py +++ b/mmgen/tool/common.py @@ -20,10 +20,12 @@ tool/common.py: Base class and shared routines for the 'mmgen-tool' utility """ +from ..objmethods import MMGenObject + def options_annot_str(l): return "(valid options: '{}')".format( "','".join(l) ) -class tool_cmd_base: +class tool_cmd_base(MMGenObject): need_proto = False need_addrtype = False diff --git a/mmgen/tool/file.py b/mmgen/tool/file.py index 6d6eebca..e797f880 100755 --- a/mmgen/tool/file.py +++ b/mmgen/tool/file.py @@ -67,6 +67,7 @@ class tool_cmd(tool_cmd_base): return self._file_chksum(mmgen_passwdfile,PasswordList) async def txview( + self, varargs_call_sig = { # hack to allow for multiple filenames 'args': ( 'mmgen_tx_file(s)', diff --git a/mmgen/wallet.py b/mmgen/wallet.py index 0849129e..c254818e 100755 --- a/mmgen/wallet.py +++ b/mmgen/wallet.py @@ -206,7 +206,7 @@ class Wallet(MMGenObject,metaclass=WalletMeta): return None @classmethod - def ext_to_type(cls,ext,proto): + def ext_to_type(cls,ext,proto=None): for c in cls.wallet_classes: if ext == getattr(c,'ext',None): return c