From 97708692bf27c662b6cfb3a433dddfa93a75180e Mon Sep 17 00:00:00 2001 From: wolfrage76 <75458290+wolfrage76@users.noreply.github.com> Date: Thu, 22 Jul 2021 14:27:52 -0400 Subject: [PATCH] Improve show -c display formatting --- flora/cmds/show.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/flora/cmds/show.py b/flora/cmds/show.py index a5fdd4f..9e14891 100644 --- a/flora/cmds/show.py +++ b/flora/cmds/show.py @@ -107,8 +107,8 @@ async def show_async( connections = await client.get_connections() print("Connections:") print( - "Type IP Ports NodeID Last Connect" - + " MiB Up|Dwn" + "Type IP Ports NodeID Last Connect" + + " MiB Up|Dwn SB Height Hash" ) for con in connections: last_connect_tuple = struct_time(localtime(con["last_message_time"])) @@ -129,17 +129,16 @@ async def show_async( if peak_height is None: peak_height = 0 con_str = ( - f"{NodeType(con['type']).name:9} {host:38} " + f"{NodeType(con['type']).name:13} {host:20} " f"{con['peer_port']:5}/{con['peer_server_port']:<5}" f" {con['node_id'].hex()[:8]}... " f"{last_connect} " f"{mb_up:7.1f}|{mb_down:<7.1f}" - f"\n " - f"-SB Height: {peak_height:8.0f} -Hash: {peak_hash[2:10]}..." + f"{peak_height:8.0f} {peak_hash[2:10]}..." ) else: con_str = ( - f"{NodeType(con['type']).name:9} {host:38} " + f"{NodeType(con['type']).name:13} {host:20} " f"{con['peer_port']:5}/{con['peer_server_port']:<5}" f" {con['node_id'].hex()[:8]}... " f"{last_connect} "