whitespace, cleanups (minor)

This commit is contained in:
The MMGen Project 2022-01-19 11:43:50 +00:00
commit 69f8d7d2fe
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
4 changed files with 5 additions and 12 deletions

View file

@ -100,7 +100,7 @@ class keygen_backend:
compressed = privkey.compressed )
class monero:
backends = ('nacl','ed25519ll_djbec','ed25519')
backends = ('nacl','ed25519ll-djbec','ed25519')
class base(keygen_base):

View file

@ -338,9 +338,10 @@ class MMGenLabel(str,Hilite,InitErrors):
def __new__(cls,s,msg=None):
if type(s) == cls:
return s
for k in cls.forbidden,cls.allowed:
for k in ( cls.forbidden, cls.allowed ):
assert type(k) == list
for ch in k: assert type(ch) == str and len(ch) == 1
for ch in k:
assert type(ch) == str and len(ch) == 1
try:
s = s.strip()
for ch in s:

View file

@ -248,14 +248,6 @@ class MMGenToolCmdMeta(type):
methods = {}
def __new__(mcls,name,bases,namespace):
methods = {k:v for k,v in namespace.items() if k[0] != '_' and callable(v) and v.__doc__}
if g.test_suite:
if name in mcls.classes:
raise ValueError(f'Class {name!r} already defined!')
for m in methods:
if m in mcls.methods:
raise ValueError(f'Method {m!r} already defined!')
if not getattr(m,'__doc__',None):
raise ValueError(f'Method {m!r} has no doc string!')
cls = super().__new__(mcls,name,bases,namespace)
if bases and name != 'tool_api':
mcls.classes[name] = cls

View file

@ -96,7 +96,7 @@ def ydie(ev=0,s=''): die(ev,yellow(s))
def pp_fmt(d):
import pprint
return pprint.PrettyPrinter(indent=4,compact=True).pformat(d)
return pprint.PrettyPrinter(indent=4,compact=False).pformat(d)
def pp_msg(d):
msg(pp_fmt(d))