Compare commits
2 Commits
master
...
lash/encry
Author | SHA1 | Date | |
---|---|---|---|
|
88b7625320 | ||
|
15463145d5 |
@ -3,6 +3,7 @@ import json
|
|||||||
|
|
||||||
# external imports
|
# external imports
|
||||||
from clicada.user import FileUserStore
|
from clicada.user import FileUserStore
|
||||||
|
from chainlib.encode import TxHexNormalizer
|
||||||
|
|
||||||
|
|
||||||
categories = [
|
categories = [
|
||||||
@ -12,7 +13,7 @@ categories = [
|
|||||||
|
|
||||||
|
|
||||||
def process_args(argparser):
|
def process_args(argparser):
|
||||||
argparser.add_argument('--category', required=True, type=str, help='Identifier category')
|
argparser.add_argument('--category', required=True, choices=categories, type=str, help='Identifier category')
|
||||||
argparser.add_argument('identifier', type=str, help='Identifier to store a display tag for')
|
argparser.add_argument('identifier', type=str, help='Identifier to store a display tag for')
|
||||||
argparser.add_argument('tag', type=str, help='Display tag to store for the identifier')
|
argparser.add_argument('tag', type=str, help='Display tag to store for the identifier')
|
||||||
|
|
||||||
@ -35,7 +36,11 @@ def validate(config, args):
|
|||||||
|
|
||||||
|
|
||||||
def execute(ctrl):
|
def execute(ctrl):
|
||||||
|
identifier = ctrl.get('_IDENTIFIER')
|
||||||
|
if ctrl.get('_CATEGORY') == 'address':
|
||||||
|
normalizer = TxHexNormalizer()
|
||||||
|
identifier = normalizer.wallet_address(identifier)
|
||||||
store_path = '.clicada'
|
store_path = '.clicada'
|
||||||
user_store = FileUserStore(None, ctrl.chain(), ctrl.get('_CATEGORY'), store_path, int(ctrl.get('FILESTORE_TTL')))
|
user_store = FileUserStore(None, ctrl.chain(), ctrl.get('_CATEGORY'), store_path, int(ctrl.get('FILESTORE_TTL')), encrypter=ctrl.encrypter)
|
||||||
user_store.put(ctrl.get('_IDENTIFIER'), json.dumps(ctrl.get('_TAG')), force=True)
|
user_store.put(identifier, json.dumps(ctrl.get('_TAG')), force=True)
|
||||||
user_store.stick(ctrl.get('_IDENTIFIER'))
|
user_store.stick(identifier)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = clicada
|
name = clicada
|
||||||
version = 0.0.6a2
|
version = 0.0.6rc1
|
||||||
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