chore: small cleanup
This commit is contained in:
parent
a3a3f55234
commit
6ac1dc88d2
@ -198,10 +198,10 @@ class CmdCtrl:
|
|||||||
|
|
||||||
def notify(self, v):
|
def notify(self, v):
|
||||||
if logg.root.level <= logging.INFO:
|
if logg.root.level <= logging.INFO:
|
||||||
print(v)
|
print("\033[96m" + v + "\033[0m")
|
||||||
|
|
||||||
def ouch(self, v):
|
def ouch(self, v):
|
||||||
print(v)
|
print("\033[91m" + v + "\033[0m")
|
||||||
|
|
||||||
def write(self, v):
|
def write(self, v):
|
||||||
print(v)
|
print(v)
|
||||||
|
@ -109,19 +109,21 @@ def execute(ctrl):
|
|||||||
encrypter=ctrl.encrypter,
|
encrypter=ctrl.encrypter,
|
||||||
)
|
)
|
||||||
|
|
||||||
ctrl.notify("resolving metadata for address {}".format(user_address_normal))
|
|
||||||
r = None
|
r = None
|
||||||
|
ctrl.write(
|
||||||
|
f"""
|
||||||
|
Phone: {ctrl.get("_IDENTIFIER")}
|
||||||
|
Network address: {add_0x(user_address)}
|
||||||
|
Chain: {ctrl.chain().common_name()}"""
|
||||||
|
)
|
||||||
|
ctrl.notify("resolving metadata for address {}".format(user_address_normal))
|
||||||
try:
|
try:
|
||||||
r = user_address_store.by_address(
|
r = user_address_store.by_address(
|
||||||
user_address_normal, update=ctrl.get("_FORCE")
|
user_address_normal, update=ctrl.get("_FORCE")
|
||||||
)
|
)
|
||||||
except MetadataNotFoundError as e:
|
if r:
|
||||||
ctrl.ouch("could not resolve metadata for user: {}".format(e))
|
|
||||||
|
|
||||||
ctrl.write(
|
ctrl.write(
|
||||||
f"""Phone: {ctrl.get("_IDENTIFIER")}
|
f"""
|
||||||
Network address: {add_0x(user_address)}
|
|
||||||
Chain: {ctrl.chain().common_name()}
|
|
||||||
Name: { str(r)}
|
Name: { str(r)}
|
||||||
Registered: {datetime.datetime.fromtimestamp(r.date_registered).ctime()}
|
Registered: {datetime.datetime.fromtimestamp(r.date_registered).ctime()}
|
||||||
Gender: {r.gender}
|
Gender: {r.gender}
|
||||||
@ -129,6 +131,8 @@ Location: {r.location["area_name"]}
|
|||||||
Products: {",".join(r.products)}
|
Products: {",".join(r.products)}
|
||||||
Tags: {",".join(r.tags)}"""
|
Tags: {",".join(r.tags)}"""
|
||||||
)
|
)
|
||||||
|
except MetadataNotFoundError as e:
|
||||||
|
ctrl.ouch(f"MetadataNotFoundError: Could not resolve metadata for user {e}\n")
|
||||||
|
|
||||||
tx_lines = []
|
tx_lines = []
|
||||||
seen_tokens = {}
|
seen_tokens = {}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = clicada
|
name = clicada
|
||||||
version = 0.1.2
|
version = 0.1.3
|
||||||
description = CLI CRM tool for the cic-stack custodial wallet system
|
description = CLI CRM tool for the cic-stack custodial wallet system
|
||||||
author = Louis Holbrook
|
author = Louis Holbrook
|
||||||
author_email = dev@holbrook.no
|
author_email = dev@holbrook.no
|
||||||
|
Loading…
Reference in New Issue
Block a user