From 966c1716505f63829bb70c063560e0d3b1cff67f Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 15 Mar 2025 18:23:16 +0000 Subject: [PATCH] update for MMGen Wallet v15.1.dev20 --- README.md | 2 +- mmgen_node_tools/Ticker.py | 14 ++++++++------ mmgen_node_tools/data/version | 2 +- mmgen_node_tools/main_addrbal.py | 8 ++++---- mmgen_node_tools/main_feeview.py | 2 +- mmgen_node_tools/main_halving_calculator.py | 8 ++++---- setup.cfg | 2 +- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 2751da7..89c43b2 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Code repository: Code repository mirrors: [Github](https://github.com/mmgen/mmgen-node-tools) | [Gitlab](https://gitlab.com/mmgen/mmgen-node-tools) | -[Gitflic](https://gitflic.ru/project/mmgen/mmgen-node-tools) +[Codeberg](https://codeberg.org/mmgen/mmgen-node-tools) [Keybase](https://keybase.io/mmgen) | [Twitter](https://twitter.com/TheMMGenProject) | [Reddit](https://www.reddit.com/user/mmgen-py) | diff --git a/mmgen_node_tools/Ticker.py b/mmgen_node_tools/Ticker.py index bae27c2..252ba6c 100755 --- a/mmgen_node_tools/Ticker.py +++ b/mmgen_node_tools/Ticker.py @@ -799,7 +799,7 @@ class Ticker: from mmgen.util2 import format_elapsed_hr fmt_func = format_elapsed_hr else: - fmt_func = lambda t,now: time.strftime('%F %X',time.gmtime(t)) + fmt_func = lambda t,now: time.strftime('%F %X', time.gmtime(t)) d = self.data max_w = 0 @@ -820,15 +820,17 @@ class Ticker: msg(str(e)) pass else: - t_fmt = d[row.id]['last_updated_fmt'] = fmt_func( (min(t,min_t) if min_t else t), now ) - max_w = max(len(t_fmt),max_w) + t_fmt = d[row.id]['last_updated_fmt'] = fmt_func( + (min(t,min_t) if min_t else t), + now = now) + max_w = max(len(t_fmt), max_w) self.upd_w = max_w def init_prec(self): - exp = [(a.id, self.prices[a.id]['usd-us-dollar'].adjusted() ) for a in self.usr_col_assets] - self.uprec = { k: max(0,v+4) + cfg.add_prec for k,v in exp } - self.uwid = { k: 12 + max(0, abs(v)-6) + cfg.add_prec for k,v in exp } + exp = [(a.id, self.prices[a.id]['usd-us-dollar'].adjusted()) for a in self.usr_col_assets] + self.uprec = {k: max(0, v+4) + cfg.add_prec for k, v in exp} + self.uwid = {k: 12 + max(0, abs(v)-6) + cfg.add_prec for k, v in exp} def get_id(self,asset): if asset.id: diff --git a/mmgen_node_tools/data/version b/mmgen_node_tools/data/version index 426110c..aa6a660 100644 --- a/mmgen_node_tools/data/version +++ b/mmgen_node_tools/data/version @@ -1 +1 @@ -3.5.dev6 +3.5.dev7 diff --git a/mmgen_node_tools/main_addrbal.py b/mmgen_node_tools/main_addrbal.py index 7fafac1..ecf2b1a 100755 --- a/mmgen_node_tools/main_addrbal.py +++ b/mmgen_node_tools/main_addrbal.py @@ -60,7 +60,7 @@ def do_output(proto,addr_data,blk_hdrs): make_timestr( blk_hdrs[u['height']]['time'] ), CoinTxID(u['txid']).hl(), red(str(u['vout']).rjust(4)), - proto.coin_amt(u['amount']).fmt(color=True,iwidth=6,prec=8) + proto.coin_amt(u['amount']).fmt(6, color=True, prec=8) )) else: Msg(f'{indent}No balance') @@ -93,18 +93,18 @@ def do_output_tabular(proto,addr_data,blk_hdrs): if unspents: Msg(fs.format( n = str(n) + ')', - a = addr.fmt(addr.view_pref, width=max_addrw, color=True), + a = addr.fmt(addr.view_pref, max_addrw, color=True), u = red(str(len(unspents)).rjust(5)), b = unspents[0]['height'], t = make_timestr( blk_hdrs[unspents[0]['height']]['time'] ), B = unspents[-1]['height'], T = make_timestr( blk_hdrs[unspents[-1]['height']]['time'] ), - A = sum(proto.coin_amt(u['amount']) for u in unspents).fmt(color=True, iwidth=7, prec=8) + A = sum(proto.coin_amt(u['amount']) for u in unspents).fmt(7, color=True, prec=8) )) else: Msg(fs.format( n = str(n) + ')', - a = addr.fmt(addr.view_pref, width=max_addrw, color=True), + a = addr.fmt(addr.view_pref, max_addrw, color=True), u = ' -', b = '-', t = '', diff --git a/mmgen_node_tools/main_feeview.py b/mmgen_node_tools/main_feeview.py index 7bee773..16591b8 100755 --- a/mmgen_node_tools/main_feeview.py +++ b/mmgen_node_tools/main_feeview.py @@ -87,7 +87,7 @@ if cfg.ignore_below: ignore_below = parse_bytespec(cfg.ignore_below) precision = ( - check_int_between(cfg.precision,min_prec,max_prec,'--precision arg') + check_int_between(cfg.precision, min_prec, max_prec, desc='--precision arg') if cfg.precision else dfl_prec ) from mmgen.term import get_terminal_size diff --git a/mmgen_node_tools/main_halving_calculator.py b/mmgen_node_tools/main_halving_calculator.py index 1648d76..caeb178 100755 --- a/mmgen_node_tools/main_halving_calculator.py +++ b/mmgen_node_tools/main_halving_calculator.py @@ -171,10 +171,10 @@ async def main(): c = date(t), d = ' P' if n > nhist else '' if n < nhist else ' E', e = f'{bdr:8.5f}', - f = proto.coin_amt(sub,from_unit='satoshi').fmt(iwidth=2,prec=8), - g = proto.coin_amt(mined,from_unit='satoshi').fmt(iwidth=8,prec=8), - h = proto.coin_amt(total_mined,from_unit='satoshi').fmt(iwidth=8,prec=8) - ) for n,sub,blk,mined,total_mined,bdr,t in gen_data()) + f = proto.coin_amt(sub, from_unit='satoshi').fmt(2, prec=8), + g = proto.coin_amt(mined, from_unit='satoshi').fmt(8, prec=8), + h = proto.coin_amt(total_mined, from_unit='satoshi').fmt(8, prec=8) + ) for n, sub, blk, mined, total_mined, bdr, t in gen_data()) ) if cfg.list: diff --git a/setup.cfg b/setup.cfg index e140080..b43abad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,7 +38,7 @@ python_requires = >=3.9 include_package_data = True install_requires = - mmgen-wallet>=15.1.dev14 + mmgen-wallet>=15.1.dev20 pyyaml yahooquery