Skip to content
Snippets Groups Projects
Commit 368d8eb4 authored by Moul's avatar Moul
Browse files

[mod] #148: consistency: rename f(), usage and print.

parent 1534b994
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ from silkaj.commands import ( ...@@ -11,7 +11,7 @@ from silkaj.commands import (
set_network_sort_keys, set_network_sort_keys,
network_info, network_info,
argos_info, argos_info,
list_issuers, list_blocks,
) )
from silkaj.tools import message_exit from silkaj.tools import message_exit
from silkaj.network_tools import get_request from silkaj.network_tools import get_request
...@@ -76,8 +76,8 @@ def usage(): ...@@ -76,8 +76,8 @@ def usage():
\n \ \n \
\n - diffi: list proof-of-work difficulty to generate next block \ \n - diffi: list proof-of-work difficulty to generate next block \
\n \ \n \
\n - blocks n: display last n issuers (`0` for current window size) \ \n - blocks n: display last n blocks (`0` for current window size) \
\n last issuers are displayed under n <= 30.\ \n last blocks are displayed under n <= 30.\
\n To force display last ones, use `--last` option\ \n To force display last ones, use `--last` option\
\n \ \n \
\n - argos: display currency information formated for Argos or BitBar\ \n - argos: display currency information formated for Argos or BitBar\
...@@ -152,7 +152,7 @@ def manage_cmd(): ...@@ -152,7 +152,7 @@ def manage_cmd():
and cli_args.subsubcmd and cli_args.subsubcmd
and int(cli_args.subsubcmd) >= 0 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": elif cli_args.subcmd == "argos":
argos_info() argos_info()
......
...@@ -222,7 +222,7 @@ def network_info(discover): ...@@ -222,7 +222,7 @@ def network_info(discover):
print(tabulate(endpoints, headers="keys", tablefmt="orgtbl", stralign="center")) print(tabulate(endpoints, headers="keys", tablefmt="orgtbl", stralign="center"))
def list_issuers(nbr, last): def list_blocks(nbr, last):
head_block = HeadBlock().head_block head_block = HeadBlock().head_block
current_nbr = head_block["number"] current_nbr = head_block["number"]
if nbr == 0: if nbr == 0:
...@@ -253,7 +253,7 @@ def list_issuers(nbr, last): ...@@ -253,7 +253,7 @@ def list_issuers(nbr, last):
issuer2["uid"] = uid issuer2["uid"] = uid
issuer2.pop("pubkey") issuer2.pop("pubkey")
print( 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 nbr, current_nbr - nbr + 1, current_nbr
), ),
end=" ", end=" ",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment