Browse Source

update for MMGen Wallet v15.1.dev20

The MMGen Project 2 weeks ago
parent
commit
966c171650

+ 1 - 1
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) |

+ 8 - 6
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:

+ 1 - 1
mmgen_node_tools/data/version

@@ -1 +1 @@
-3.5.dev6
+3.5.dev7

+ 4 - 4
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 = '',

+ 1 - 1
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

+ 4 - 4
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:

+ 1 - 1
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