Merge pull request 'fix: make store path relative to $HOME' (#17) from lum/store_path into master
Reviewed-on: #17
This commit is contained in:
commit
c269318528
@ -3,7 +3,8 @@ import json
|
|||||||
|
|
||||||
# external imports
|
# external imports
|
||||||
from clicada.user import FileUserStore
|
from clicada.user import FileUserStore
|
||||||
|
from pathlib import Path
|
||||||
|
import os
|
||||||
|
|
||||||
categories = [
|
categories = [
|
||||||
'phone',
|
'phone',
|
||||||
@ -35,7 +36,7 @@ def validate(config, args):
|
|||||||
|
|
||||||
|
|
||||||
def execute(ctrl):
|
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 = 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.put(ctrl.get('_IDENTIFIER'), json.dumps(ctrl.get('_TAG')), force=True)
|
||||||
user_store.stick(ctrl.get('_IDENTIFIER'))
|
user_store.stick(ctrl.get('_IDENTIFIER'))
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
import datetime
|
import datetime
|
||||||
|
from pathlib import Path
|
||||||
|
import os
|
||||||
|
|
||||||
# external imports
|
# external imports
|
||||||
from cic_eth_registry import CICRegistry
|
from cic_eth_registry import CICRegistry
|
||||||
@ -54,7 +56,7 @@ def validate(config, args):
|
|||||||
def execute(ctrl):
|
def execute(ctrl):
|
||||||
tx_getter = TxGetter(ctrl.get('TX_CACHE_URL'), 10)
|
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_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)
|
user_phone_store = FileUserStore(ctrl.opener('meta'), ctrl.chain(), user_phone_file_label, store_path, int(ctrl.get('FILESTORE_TTL')), encrypter=ctrl.encrypter)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user