From 1bbb1816e1846a279c87c95e11038f1601b652a6 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 15 Mar 2025 18:24:52 +0000 Subject: [PATCH] tw,tx: make parameters `width` and `iwidth` positional-only --- mmgen/addr.py | 10 +++++----- mmgen/amt.py | 2 +- mmgen/autosign.py | 4 ++-- mmgen/obj.py | 10 +++++----- mmgen/objmethods.py | 5 +++-- mmgen/proto/btc/tw/txhistory.py | 14 +++++++------- mmgen/proto/btc/tx/info.py | 20 +++++++++---------- mmgen/proto/eth/tx/info.py | 4 ++-- mmgen/tw/addresses.py | 16 ++++++++-------- mmgen/tw/bal.py | 2 +- mmgen/tw/shared.py | 4 ++-- mmgen/tw/txhistory.py | 4 ++-- mmgen/tw/unspent.py | 34 ++++++++++++++++----------------- mmgen/tx/info.py | 10 +++++----- mmgen/xmrwallet/file/tx.py | 6 +++--- mmgen/xmrwallet/include.py | 2 +- mmgen/xmrwallet/ops/__init__.py | 2 +- mmgen/xmrwallet/ops/label.py | 2 +- mmgen/xmrwallet/rpc.py | 2 +- 19 files changed, 77 insertions(+), 76 deletions(-) diff --git a/mmgen/addr.py b/mmgen/addr.py index c5bb2b68..ee28bacd 100755 --- a/mmgen/addr.py +++ b/mmgen/addr.py @@ -182,14 +182,14 @@ class CoinAddr(HiliteStr, InitErrors, MMGenObject): # reimplement some HiliteStr methods: @classmethod - def fmtc(cls, s, width, *, color=False): - return super().fmtc(s=s[:width-2]+'..' if len(s) > width else s, width=width, color=color) + def fmtc(cls, s, width, /, *, color=False): + return super().fmtc(s[:width-2]+'..' if len(s) > width else s, width, color=color) - def fmt(self, view_pref, width, *, color=False): + def fmt(self, view_pref, width, /, *, color=False): s = self.views[view_pref] - return super().fmtc(f'{s[:width-2]}..' if len(s) > width else s, width=width, color=color) + return super().fmtc(f'{s[:width-2]}..' if len(s) > width else s, width, color=color) - def hl(self, view_pref, *, color=True): + def hl(self, view_pref, /, *, color=True): return getattr(color_mod, self.color)(self.views[view_pref]) if color else self.views[view_pref] def is_coin_addr(proto, s): diff --git a/mmgen/amt.py b/mmgen/amt.py index e9db6eeb..004acab1 100755 --- a/mmgen/amt.py +++ b/mmgen/amt.py @@ -71,7 +71,7 @@ class CoinAmt(Decimal, Hilite, InitErrors): # abstract class def fmtc(cls, *args, **kwargs): cls.method_not_implemented() - def fmt(self, *, color=False, iwidth=1, prec=None): # iwidth: width of the integer part + def fmt(self, iwidth=1, /, *, color=False, prec=None): # iwidth: width of the integer part prec = prec or self.max_prec if '.' in (s := str(self)): a, b = s.split('.', 1) diff --git a/mmgen/autosign.py b/mmgen/autosign.py index 2a941a1e..76bf4bbf 100755 --- a/mmgen/autosign.py +++ b/mmgen/autosign.py @@ -310,8 +310,8 @@ class Signable: for tx, non_mmgen in body: for nm in non_mmgen: yield fs.format( - tx.txid.fmt(width=t_wid, color=True) if nm is non_mmgen[0] else ' '*t_wid, - nm.addr.fmt(nm.addr.view_pref, width=a_wid, color=True), + tx.txid.fmt(t_wid, color=True) if nm is non_mmgen[0] else ' '*t_wid, + nm.addr.fmt(nm.addr.view_pref, a_wid, color=True), nm.amt.hl() + ' ' + yellow(tx.coin)) msg('\n' + '\n'.join(gen())) diff --git a/mmgen/obj.py b/mmgen/obj.py index 08627d6b..fce0df88 100755 --- a/mmgen/obj.py +++ b/mmgen/obj.py @@ -280,11 +280,11 @@ class Int(int, Hilite, InitErrors): return cls.init_fail(e, n) @classmethod - def fmtc(cls, s, width, *, color=False): - return super().fmtc(str(s), width=width, color=color) + def fmtc(cls, s, width, /, *, color=False): + return super().fmtc(str(s), width, color=color) - def fmt(self, width, *, color=False): - return super().fmtc(str(self), width=width, color=color) + def fmt(self, width, /, *, color=False): + return super().fmtc(str(self), width, color=color) def hl(self, **kwargs): return super().colorize(str(self), **kwargs) @@ -324,7 +324,7 @@ class HexStr(HiliteStr, InitErrors): except Exception as e: return cls.init_fail(e, s) - def truncate(self, width, *, color=True): + def truncate(self, width, /, *, color=True): return self.colorize( self if width >= self.width else self[:width-2] + '..', color = color) diff --git a/mmgen/objmethods.py b/mmgen/objmethods.py index 35ccf13a..c257b2b8 100755 --- a/mmgen/objmethods.py +++ b/mmgen/objmethods.py @@ -49,7 +49,7 @@ class Hilite: # class method equivalent of fmt() @classmethod - def fmtc(cls, s, width, *, color=False): + def fmtc(cls, s, width, /, *, color=False): if len(s) > width: assert cls.trunc_ok, "If 'trunc_ok' is false, 'width' must be >= width of string" return cls.colorize(s[:width].ljust(width), color=color) @@ -71,7 +71,7 @@ class Hilite: class HiliteStr(str, Hilite): # supports single-width characters only - def fmt(self, width, *, color=False): + def fmt(self, width, /, *, color=False): if len(self) > width: assert self.trunc_ok, "If 'trunc_ok' is false, 'width' must be >= width of string" return self.colorize(self[:width].ljust(width), color=color) @@ -82,6 +82,7 @@ class HiliteStr(str, Hilite): def fmt2( self, width, # screen width - must be at least 2 (one wide char) + /, *, color = False, encl = '', # if set, must be exactly 2 single-width chars diff --git a/mmgen/proto/btc/tw/txhistory.py b/mmgen/proto/btc/tw/txhistory.py index 8886f682..02d1e4d6 100755 --- a/mmgen/proto/btc/tw/txhistory.py +++ b/mmgen/proto/btc/tw/txhistory.py @@ -147,8 +147,8 @@ class BitcoinTwTransaction: def txdate_disp(self, age_fmt): return self.parent.date_formatter[age_fmt](self.rpc, self.time) - def txid_disp(self, color, width=None): - return self.txid.hl(color=color) if width is None else self.txid.truncate(width=width, color=color) + def txid_disp(self, *, color, width=None): + return self.txid.hl(color=color) if width is None else self.txid.truncate(width, color=color) def vouts_list_disp(self, src, color, indent, addr_view_pref): @@ -165,9 +165,9 @@ class BitcoinTwTransaction: i = CoinTxID(e.txid).hl(color=color), n = (nocolor, red)[color](str(e.data['n']).ljust(3)), a = CoinAddr(self.proto, e.coin_addr).fmt( - addr_view_pref, width=self.max_addrlen[src], color=color) + addr_view_pref, self.max_addrlen[src], color=color) if e.coin_addr != self.no_address_str else - CoinAddr.fmtc(e.coin_addr, width=self.max_addrlen[src], color=color), + CoinAddr.fmtc(e.coin_addr, self.max_addrlen[src], color=color), A = self.proto.coin_amt(e.data['value']).fmt(color=color) ).rstrip() else: @@ -200,9 +200,9 @@ class BitcoinTwTransaction: if width and space_left < addr_w: break yield ( - CoinAddr(self.proto, e.coin_addr).fmt(addr_view_pref, width=addr_w, color=color) + CoinAddr(self.proto, e.coin_addr).fmt(addr_view_pref, addr_w, color=color) if e.coin_addr != self.no_address_str else - CoinAddr.fmtc(e.coin_addr, width=addr_w, color=color)) + CoinAddr.fmtc(e.coin_addr, addr_w, color=color)) space_left -= addr_w elif mmid.type == 'mmgen': mmid_disp = mmid + bal_star @@ -215,7 +215,7 @@ class BitcoinTwTransaction: break yield TwMMGenID.hl2( TwMMGenID, - s = CoinAddr.fmtc(mmid.split(':', 1)[1] + bal_star, width=addr_w), + s = CoinAddr.fmtc(mmid.split(':', 1)[1] + bal_star, addr_w), color = color, color_override = co) space_left -= addr_w diff --git a/mmgen/proto/btc/tx/info.py b/mmgen/proto/btc/tx/info.py index 9cc6cf66..a03a0964 100755 --- a/mmgen/proto/btc/tx/info.py +++ b/mmgen/proto/btc/tx/info.py @@ -36,8 +36,8 @@ class TxInfo(TxInfo): pink('{:0.6f}%'.format(tx.fee / tx.send_amt * 100)) ) - def format_abs_fee(self, color, iwidth): - return self.tx.fee.fmt(color=color, iwidth=iwidth) + def format_abs_fee(self, iwidth, /, *, color=None): + return self.tx.fee.fmt(iwidth, color=color) def format_verbose_footer(self): tx = self.tx @@ -58,15 +58,15 @@ class TxInfo(TxInfo): def get_mmid_fmt(e, is_input): if e.mmid: return e.mmid.fmt2( - width=max_mmwid, - encl='()', - color=True, - append_chars=('', ' (chg)')[bool(not is_input and e.is_chg and terse)], - append_color='green') + max_mmwid, + encl = '()', + color = True, + append_chars = ('', ' (chg)')[bool(not is_input and e.is_chg and terse)], + append_color = 'green') else: return MMGenID.fmtc( '[vault address]' if not is_input and e.is_vault else nonmm_str, - width = max_mmwid, + max_mmwid, color = True) def format_io(desc): @@ -91,9 +91,9 @@ class TxInfo(TxInfo): for n, e in enumerate(io_sorted()): yield '{:3} {} {} {} {}\n'.format( n+1, - e.addr.fmt(vp1, width=addr_w, color=True) if e.addr else blue(data_disp(e.data).ljust(addr_w)), + e.addr.fmt(vp1, addr_w, color=True) if e.addr else blue(data_disp(e.data).ljust(addr_w)), get_mmid_fmt(e, is_input) if e.addr else ''.ljust(max_mmwid), - e.amt.fmt(iwidth=iwidth, color=True), + e.amt.fmt(iwidth, color=True), tx.dcoin) if have_bch and e.addr: yield '{:3} [{}]\n'.format('', e.addr.hl(vp2, color=False)) diff --git a/mmgen/proto/eth/tx/info.py b/mmgen/proto/eth/tx/info.py index 7c033700..38215d48 100755 --- a/mmgen/proto/eth/tx/info.py +++ b/mmgen/proto/eth/tx/info.py @@ -59,8 +59,8 @@ class TxInfo(TxInfo): t_mmid = m['outputs'] if len(tx.outputs) else '', f_mmid = m['inputs']) + '\n\n' - def format_abs_fee(self, color, iwidth): - return self.tx.fee.fmt(color=color, iwidth=iwidth) + (' (max)' if self.tx.txobj['data'] else '') + def format_abs_fee(self, iwidth, /, *, color=None): + return self.tx.fee.fmt(iwidth, color=color) + (' (max)' if self.tx.txobj['data'] else '') def format_rel_fee(self): return ' ({} of spend amount)'.format( diff --git a/mmgen/tw/addresses.py b/mmgen/tw/addresses.py index 65d329de..ce8b9325 100755 --- a/mmgen/tw/addresses.py +++ b/mmgen/tw/addresses.py @@ -174,22 +174,22 @@ class TwAddresses(TwView): def squeezed_format_line(self, n, d, cw, fs, color, yes, no): return fs.format( n = str(n) + ')', - m = d.twmmid.fmt(width=cw.mmid, color=color), + m = d.twmmid.fmt(cw.mmid, color=color), u = yes if d.recvd else no, - a = d.addr.fmt(self.addr_view_pref, width=cw.addr, color=color), - c = d.comment.fmt2(width=cw.comment, color=color, nullrepl='-'), - A = d.amt.fmt(color=color, iwidth=cw.iwidth, prec=self.disp_prec), + a = d.addr.fmt(self.addr_view_pref, cw.addr, color=color), + c = d.comment.fmt2(cw.comment, color=color, nullrepl='-'), + A = d.amt.fmt(cw.iwidth, color=color, prec=self.disp_prec), d = self.age_disp(d, self.age_fmt) ) def detail_format_line(self, n, d, cw, fs, color, yes, no): return fs.format( n = str(n) + ')', - m = d.twmmid.fmt(width=cw.mmid, color=color), + m = d.twmmid.fmt(cw.mmid, color=color), u = yes if d.recvd else no, - a = d.addr.fmt(self.addr_view_pref, width=cw.addr, color=color), - c = d.comment.fmt2(width=cw.comment, color=color, nullrepl='-'), - A = d.amt.fmt(color=color, iwidth=cw.iwidth, prec=self.disp_prec), + a = d.addr.fmt(self.addr_view_pref, cw.addr, color=color), + c = d.comment.fmt2(cw.comment, color=color, nullrepl='-'), + A = d.amt.fmt(cw.iwidth, color=color, prec=self.disp_prec), b = self.age_disp(d, 'block'), D = self.age_disp(d, 'date_time')) diff --git a/mmgen/tw/bal.py b/mmgen/tw/bal.py index 7a265df8..295a0c9f 100755 --- a/mmgen/tw/bal.py +++ b/mmgen/tw/bal.py @@ -65,7 +65,7 @@ class TwGetBalance(MMGenObject, metaclass=AsyncInit): return len(str(int(max(v[colname] for v in self.data.values())))) + iwidth_adj def make_col(label, col): - return self.data[label][col].fmt(iwidth=iwidths[col], color=color) + return self.data[label][col].fmt(iwidths[col], color=color) if color: from ..color import green, yellow diff --git a/mmgen/tw/shared.py b/mmgen/tw/shared.py index 0c313c97..8bbadf2c 100755 --- a/mmgen/tw/shared.py +++ b/mmgen/tw/shared.py @@ -45,8 +45,8 @@ class TwMMGenID(HiliteStr, InitErrors, MMGenObject): me.proto = proto return me - def fmt(self, **kwargs): - return super().fmtc(self.disp, **kwargs) + def fmt(self, width, /, **kwargs): + return super().fmtc(self.disp, width, **kwargs) # non-displaying container for TwMMGenID, TwComment class TwLabel(str, InitErrors, MMGenObject): diff --git a/mmgen/tw/txhistory.py b/mmgen/tw/txhistory.py index 72987d1e..87e8fbd7 100755 --- a/mmgen/tw/txhistory.py +++ b/mmgen/tw/txhistory.py @@ -132,9 +132,9 @@ class TwTxHistory(TwView): t = d.txid_disp(width=cw.txid, color=color) if hasattr(cw, 'txid') else None, d = d.age_disp(self.age_fmt, width=self.age_w, color=color), i = d.vouts_disp('inputs', width=cw.inputs, color=color, addr_view_pref=self.addr_view_pref), - A = d.amt_disp(self.show_total_amt).fmt(iwidth=cw.iwidth, prec=self.disp_prec, color=color), + A = d.amt_disp(self.show_total_amt).fmt(cw.iwidth, prec=self.disp_prec, color=color), o = d.vouts_disp('outputs', width=cw.outputs, color=color, addr_view_pref=self.addr_view_pref), - c = d.comment.fmt2(width=cw.comment, color=color, nullrepl='-')) + c = d.comment.fmt2(cw.comment, color=color, nullrepl='-')) def gen_detail_display(self, data, cw, fs, color, fmt_method): diff --git a/mmgen/tw/unspent.py b/mmgen/tw/unspent.py index dcb809f7..ff85b310 100755 --- a/mmgen/tw/unspent.py +++ b/mmgen/tw/unspent.py @@ -177,16 +177,16 @@ class TwUnspentOutputs(TwView): for n, d in enumerate(data): yield fs.format( n = str(n+1) + ')', - t = (d.txid.fmtc('|' + '.'*(cw.txid-1), width=cw.txid, color=color) if d.skip == 'txid' - else d.txid.truncate(width=cw.txid, color=color)) if cw.txid else None, - v = ' ' + d.vout.fmt(width=cw.vout-1, color=color) if cw.vout else None, - a = d.addr.fmtc('|' + '.'*(cw.addr-1), width=cw.addr, color=color) if d.skip == 'addr' - else d.addr.fmt(self.addr_view_pref, width=cw.addr, color=color), - m = (d.twmmid.fmtc('.'*cw.mmid, width=cw.mmid, color=color) if d.skip == 'addr' - else d.twmmid.fmt(width=cw.mmid, color=color)) if cw.mmid else None, - c = d.comment.fmt2(width=cw.comment, color=color, nullrepl='-') if cw.comment else None, - A = d.amt.fmt(color=color, iwidth=cw.iwidth, prec=self.disp_prec), - B = d.amt2.fmt(color=color, iwidth=cw.iwidth2, prec=self.disp_prec) if cw.amt2 else None, + t = (d.txid.fmtc('|' + '.'*(cw.txid-1), cw.txid, color=color) if d.skip == 'txid' + else d.txid.truncate(cw.txid, color=color)) if cw.txid else None, + v = ' ' + d.vout.fmt(cw.vout-1, color=color) if cw.vout else None, + a = d.addr.fmtc('|' + '.'*(cw.addr-1), cw.addr, color=color) if d.skip == 'addr' + else d.addr.fmt(self.addr_view_pref, cw.addr, color=color), + m = (d.twmmid.fmtc('.'*cw.mmid, cw.mmid, color=color) if d.skip == 'addr' + else d.twmmid.fmt(cw.mmid, color=color)) if cw.mmid else None, + c = d.comment.fmt2(cw.comment, color=color, nullrepl='-') if cw.comment else None, + A = d.amt.fmt(cw.iwidth, color=color, prec=self.disp_prec), + B = d.amt2.fmt(cw.iwidth2, color=color, prec=self.disp_prec) if cw.amt2 else None, d = self.age_disp(d, self.age_fmt), ) @@ -195,15 +195,15 @@ class TwUnspentOutputs(TwView): for n, d in enumerate(data): yield fs.format( n = str(n+1) + ')', - t = d.txid.fmt(width=cw.txid, color=color) if cw.txid else None, - v = ' ' + d.vout.fmt(width=cw.vout-1, color=color) if cw.vout else None, - a = d.addr.fmt(self.addr_view_pref, width=cw.addr, color=color), - m = d.twmmid.fmt(width=cw.mmid, color=color), - A = d.amt.fmt(color=color, iwidth=cw.iwidth, prec=self.disp_prec), - B = d.amt2.fmt(color=color, iwidth=cw.iwidth2, prec=self.disp_prec) if cw.amt2 else None, + t = d.txid.fmt(cw.txid, color=color) if cw.txid else None, + v = ' ' + d.vout.fmt(cw.vout-1, color=color) if cw.vout else None, + a = d.addr.fmt(self.addr_view_pref, cw.addr, color=color), + m = d.twmmid.fmt(cw.mmid, color=color), + A = d.amt.fmt(cw.iwidth, color=color, prec=self.disp_prec), + B = d.amt2.fmt(cw.iwidth2, color=color, prec=self.disp_prec) if cw.amt2 else None, b = self.age_disp(d, 'block'), D = self.age_disp(d, 'date_time'), - c = d.comment.fmt2(width=cw.comment, color=color, nullrepl='-')) + c = d.comment.fmt2(cw.comment, color=color, nullrepl='-')) def display_total(self): msg('\nTotal unspent: {} {} ({} output{})'.format( diff --git a/mmgen/tx/info.py b/mmgen/tx/info.py index 91faf417..22412242 100755 --- a/mmgen/tx/info.py +++ b/mmgen/tx/info.py @@ -101,11 +101,11 @@ class TxInfo: iwidth = len(str(int(tx.sum_inputs()))) yield self.txinfo_ftr_fs.format( - i = tx.sum_inputs().fmt(color=True, iwidth=iwidth), - o = tx.sum_outputs().fmt(color=True, iwidth=iwidth), - C = tx.change.fmt(color=True, iwidth=iwidth), - s = tx.send_amt.fmt(color=True, iwidth=iwidth), - a = self.format_abs_fee(color=True, iwidth=iwidth), + i = tx.sum_inputs().fmt(iwidth, color=True), + o = tx.sum_outputs().fmt(iwidth, color=True), + C = tx.change.fmt(iwidth, color=True), + s = tx.send_amt.fmt(iwidth, color=True), + a = self.format_abs_fee(iwidth, color=True), r = self.format_rel_fee(), d = tx.dcoin, c = tx.coin) diff --git a/mmgen/xmrwallet/file/tx.py b/mmgen/xmrwallet/file/tx.py index aa469033..e3942714 100755 --- a/mmgen/xmrwallet/file/tx.py +++ b/mmgen/xmrwallet/file/tx.py @@ -94,8 +94,8 @@ class MoneroMMGenTX: e = purple(d.op.ljust(9)), f = red('{}:{}'.format(d.source.wallet, d.source.account).ljust(6)), g = red('{}:{}'.format(d.dest.wallet, d.dest.account).ljust(6)) if d.dest else cyan('ext '), - h = d.amount.fmt(color=True, iwidth=4, prec=12), - j = d.dest_address.fmt(0, width=addr_w, color=True) if addr_w else d.dest_address.hl(0), + h = d.amount.fmt(4, color=True, prec=12), + j = d.dest_address.fmt(0, addr_w, color=True) if addr_w else d.dest_address.hl(0), x = '->' ) @@ -138,7 +138,7 @@ class MoneroMMGenTX: F = (Int(d.priority).hl() + f' [{tx_priorities[d.priority]}]') if d.priority else None, n = d.fee.hl(), o = d.dest_address.hl(0) if self.cfg.full_address - else d.dest_address.fmt(0, width=addr_width, color=True), + else d.dest_address.fmt(0, addr_width, color=True), P = pink(pmt_id.hex()) if pmt_id else None, s = make_timestr(d.submit_time) if d.submit_time else None, S = pink(f" [cold signed{', submitted' if d.complete else ''}]") if d.signed_txset else '', diff --git a/mmgen/xmrwallet/include.py b/mmgen/xmrwallet/include.py index 6f080ab7..733216c5 100755 --- a/mmgen/xmrwallet/include.py +++ b/mmgen/xmrwallet/include.py @@ -47,7 +47,7 @@ def gen_acct_addr_info(self, wallet_data, account, indent=''): from .ops import fmt_amt yield fs.format( I = addr['address_index'], - A = ca.hl(0) if self.cfg.full_address else ca.fmt(0, color=True, width=addr_width), + A = ca.hl(0) if self.cfg.full_address else ca.fmt(0, addr_width, color=True), U = (red('True ') if addr['used'] else green('False')), B = fmt_amt(bal), L = pink(addr['label'])) diff --git a/mmgen/xmrwallet/ops/__init__.py b/mmgen/xmrwallet/ops/__init__.py index f6f6fa4e..578536b1 100755 --- a/mmgen/xmrwallet/ops/__init__.py +++ b/mmgen/xmrwallet/ops/__init__.py @@ -51,7 +51,7 @@ class OpBase: self.uargs = uarg_tuple def fmt_amt(amt): - return self.proto.coin_amt(amt, from_unit='atomic').fmt(iwidth=5, prec=12, color=True) + return self.proto.coin_amt(amt, from_unit='atomic').fmt(5, prec=12, color=True) def hl_amt(amt): return self.proto.coin_amt(amt, from_unit='atomic').hl() diff --git a/mmgen/xmrwallet/ops/label.py b/mmgen/xmrwallet/ops/label.py index 9ac7b204..0d3b7352 100755 --- a/mmgen/xmrwallet/ops/label.py +++ b/mmgen/xmrwallet/ops/label.py @@ -59,7 +59,7 @@ class OpLabel(OpMixinSpec, OpWallet): from . import addr_width msg('\n {a} {b}\n {c} {d}\n {e} {f}'.format( a = 'Address: ', - b = ca.hl(0) if self.cfg.full_address else ca.fmt(0, color=True, width=addr_width), + b = ca.hl(0) if self.cfg.full_address else ca.fmt(0, addr_width, color=True), c = 'Existing label:', d = pink(addr['label']) if addr['label'] else gray('[none]'), e = 'New label: ', diff --git a/mmgen/xmrwallet/rpc.py b/mmgen/xmrwallet/rpc.py index 1724cc48..c3f8a63d 100755 --- a/mmgen/xmrwallet/rpc.py +++ b/mmgen/xmrwallet/rpc.py @@ -79,7 +79,7 @@ class MoneroWalletRPC: from .ops import fmt_amt yield fs.format( I = str(e['account_index']), - A = ca.hl(0) if self.cfg.full_address else ca.fmt(0, color=True, width=addr_width), + A = ca.hl(0) if self.cfg.full_address else ca.fmt(0, addr_width, color=True), N = red(str(len(addrs_data[i]['addresses'])).ljust(6)), B = fmt_amt(e['unlocked_balance']), L = pink(e['label']))