From 368d8eb43457dc2472f2f66932f00d39f2f93f4d Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Mon, 10 Dec 2018 15:35:55 +0100 Subject: [PATCH] [mod] #148: consistency: rename f(), usage and print. --- silkaj/cli_tools.py | 8 ++++---- silkaj/commands.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/silkaj/cli_tools.py b/silkaj/cli_tools.py index d1db8d00..d4436761 100644 --- a/silkaj/cli_tools.py +++ b/silkaj/cli_tools.py @@ -11,7 +11,7 @@ from silkaj.commands import ( set_network_sort_keys, network_info, argos_info, - list_issuers, + list_blocks, ) from silkaj.tools import message_exit from silkaj.network_tools import get_request @@ -76,8 +76,8 @@ def usage(): \n \ \n - diffi: list proof-of-work difficulty to generate next block \ \n \ - \n - blocks n: display last n issuers (`0` for current window size) \ - \n last issuers are displayed under n <= 30.\ + \n - blocks n: display last n blocks (`0` for current window size) \ + \n last blocks are displayed under n <= 30.\ \n To force display last ones, use `--last` option\ \n \ \n - argos: display currency information formated for Argos or BitBar\ @@ -152,7 +152,7 @@ def manage_cmd(): and cli_args.subsubcmd and int(cli_args.subsubcmd) >= 0 ): - list_issuers(int(cli_args.subsubcmd), cli_args.contains_switches("last")) + list_blocks(int(cli_args.subsubcmd), cli_args.contains_switches("last")) elif cli_args.subcmd == "argos": argos_info() diff --git a/silkaj/commands.py b/silkaj/commands.py index 374a16d2..451fba2f 100644 --- a/silkaj/commands.py +++ b/silkaj/commands.py @@ -222,7 +222,7 @@ def network_info(discover): print(tabulate(endpoints, headers="keys", tablefmt="orgtbl", stralign="center")) -def list_issuers(nbr, last): +def list_blocks(nbr, last): head_block = HeadBlock().head_block current_nbr = head_block["number"] if nbr == 0: @@ -253,7 +253,7 @@ def list_issuers(nbr, last): issuer2["uid"] = uid issuer2.pop("pubkey") print( - "Issuers for last {0} blocks from block n°{1} to block n°{2}".format( + "Last {0} blocks from n°{1} to n°{2}".format( nbr, current_nbr - nbr + 1, current_nbr ), end=" ", -- GitLab