minor fixes and cleanups

This commit is contained in:
The MMGen Project 2022-02-05 13:32:53 +00:00
commit 3c015fa34f
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 6 additions and 2 deletions

View file

@ -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]

View file

@ -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

View file

@ -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)',

View file

@ -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