Drop `config` get/set/del apis..

account_tests
Tyler Goodlet 2023-07-10 09:26:42 -04:00
parent ff267890d1
commit 87185cf8bb
1 changed files with 0 additions and 48 deletions

View File

@ -378,51 +378,3 @@ def load_accounts(
accounts['paper'] = None
return accounts
# XXX: Recursive getting & setting
def get_value(_dict, _section):
subs = _section.split('.')
if len(subs) > 1:
return get_value(
_dict[subs[0]],
'.'.join(subs[1:]),
)
else:
return _dict[_section]
def set_value(_dict, _section, val):
subs = _section.split('.')
if len(subs) > 1:
if subs[0] not in _dict:
_dict[subs[0]] = {}
return set_value(
_dict[subs[0]],
'.'.join(subs[1:]),
val
)
else:
_dict[_section] = val
def del_value(_dict, _section):
subs = _section.split('.')
if len(subs) > 1:
if subs[0] not in _dict:
return
return del_value(
_dict[subs[0]],
'.'.join(subs[1:])
)
else:
if _section not in _dict:
return
del _dict[_section]