whitespace, cleanups (minor)
This commit is contained in:
parent
67067aa7d5
commit
69f8d7d2fe
4 changed files with 5 additions and 12 deletions
|
|
@ -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):
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue