Skip to content
Snippets Groups Projects
Commit 42e94b09 authored by Moul's avatar Moul
Browse files

[fix] #81: wot: seach for corresponding identity amoungs identities.

parent e33a05d9
No related branches found
No related tags found
No related merge requests found
......@@ -25,17 +25,22 @@ def received_sent_certifications(ep, id):
"""
if get_pubkeys_from_id(ep, id) == NO_MATCHING_ID:
message_exit(NO_MATCHING_ID)
certs_req = get_request(ep, "wot/lookup/" + id)["results"][0]
certs_req = get_request(ep, "wot/lookup/" + id)["results"]
for certs_id in certs_req:
print(certs_id['uids'][0]['uid'], id)
if certs_id['uids'][0]['uid'].lower() == id.lower():
id_certs = certs_id
break
certifications = OrderedDict()
os.system("clear")
for certs in certs_req["uids"]:
for certs in id_certs["uids"]:
if certs["uid"].lower() == id.lower():
certifications["received"] = list()
for cert in certs["others"]:
certifications["received"].append(cert["uids"][0])
certifications["sent"] = get_sent_certifications(certs_req)
certifications["sent"] = get_sent_certifications(id_certs)
print("{0} ({1}) from block #{2}\nreceived {3} and sent {4} certifications:\n{5}\n"
.format(id, certs_req["pubkey"][:5] + "", certs["meta"]["timestamp"][:15] + "",
.format(id, id_certs["pubkey"][:5] + "", certs["meta"]["timestamp"][:15] + "",
len(certifications["received"]), len(certifications["sent"]),
tabulate(certifications, headers="keys", tablefmt="orgtbl", stralign="center")))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment