From 07ffd290a319e875a9d7e638b470d1e92216cb2e Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Sun, 30 Aug 2020 11:36:56 +0200 Subject: [PATCH] [mod] #140: Change argument name for better --help To know that an uid and a pubkey can be passed as argument It is not possible to add an help on argument() as for option() https://click.palletsprojects.com/en/7.x/arguments/ --- silkaj/cert.py | 6 +++--- silkaj/wot.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/silkaj/cert.py b/silkaj/cert.py index 46c14a98..1b2ad08f 100644 --- a/silkaj/cert.py +++ b/silkaj/cert.py @@ -33,12 +33,12 @@ from silkaj.constants import SUCCESS_EXIT_STATUS @command("cert", help="Send certification") -@argument("id_to_certify") +@argument("uid_pubkey_to_certify") @coroutine -async def send_certification(id_to_certify): +async def send_certification(uid_pubkey_to_certify): client = ClientInstance().client idty_to_certify, pubkey_to_certify, send_certs = await wot.choose_identity( - id_to_certify + uid_pubkey_to_certify ) # Authentication diff --git a/silkaj/wot.py b/silkaj/wot.py index 4de61ac3..efe87ddd 100644 --- a/silkaj/wot.py +++ b/silkaj/wot.py @@ -49,9 +49,9 @@ def get_sent_certifications(signed, time_first_block, params): "wot", help="Check received and sent certifications and consult the membership status of any given identity", ) -@click.argument("id") +@click.argument("uid_pubkey") @coroutine -async def received_sent_certifications(id): +async def received_sent_certifications(uid_pubkey): """ get searched id get id of received and sent certifications @@ -60,7 +60,7 @@ async def received_sent_certifications(id): client = ClientInstance().client first_block = await client(blockchain.block, 1) time_first_block = first_block["time"] - identity, pubkey, signed = await choose_identity(id) + identity, pubkey, signed = await choose_identity(uid_pubkey) certifications = OrderedDict() params = await BlockchainParams().params req = await client(wot.requirements, pubkey) @@ -83,7 +83,7 @@ async def received_sent_certifications(id): nbr_sent_certs = len(certifications["sent"]) if "sent" in certifications else 0 print( "{0} ({1}) from block #{2}\nreceived {3} and sent {4}/{5} certifications:\n{6}\n{7}\n".format( - id, + identity["uid"], pubkey[:5] + "…", identity["meta"]["timestamp"][:15] + "…", len(certifications["received"]), -- GitLab