From c3e8883f15e1df24c7bcea6e44dbe3d2319fd600 Mon Sep 17 00:00:00 2001 From: William Luke Date: Thu, 31 Mar 2022 12:33:29 +0300 Subject: [PATCH] fix: make store path relative to $HOME --- clicada/cli/tag.py | 5 +++-- clicada/cli/user.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/clicada/cli/tag.py b/clicada/cli/tag.py index cbb1312..77ebd59 100644 --- a/clicada/cli/tag.py +++ b/clicada/cli/tag.py @@ -3,7 +3,8 @@ import json # external imports from clicada.user import FileUserStore - +from pathlib import Path +import os categories = [ 'phone', @@ -35,7 +36,7 @@ def validate(config, args): def execute(ctrl): - store_path = '.clicada' + store_path = os.path.join(str(Path.home()), '.clicada') user_store = FileUserStore(None, ctrl.chain(), ctrl.get('_CATEGORY'), store_path, int(ctrl.get('FILESTORE_TTL'))) user_store.put(ctrl.get('_IDENTIFIER'), json.dumps(ctrl.get('_TAG')), force=True) user_store.stick(ctrl.get('_IDENTIFIER')) diff --git a/clicada/cli/user.py b/clicada/cli/user.py index 92a0aa0..27a5146 100644 --- a/clicada/cli/user.py +++ b/clicada/cli/user.py @@ -2,6 +2,8 @@ import sys import logging import datetime +from pathlib import Path +import os # external imports from cic_eth_registry import CICRegistry @@ -54,7 +56,7 @@ def validate(config, args): def execute(ctrl): tx_getter = TxGetter(ctrl.get('TX_CACHE_URL'), 10) - store_path = '.clicada' + store_path = os.path.join(str(Path.home()), '.clicada') user_phone_file_label = 'phone' user_phone_store = FileUserStore(ctrl.opener('meta'), ctrl.chain(), user_phone_file_label, store_path, int(ctrl.get('FILESTORE_TTL')), encrypter=ctrl.encrypter) -- 2.45.2