forked from LBRYCommunity/lbry-sdk
generate docs
This commit is contained in:
parent
d2ad3e7ff1
commit
36fbd91280
4 changed files with 204 additions and 108 deletions
File diff suppressed because one or more lines are too long
|
@ -377,12 +377,11 @@ class BaseConfig:
|
|||
|
||||
@contextmanager
|
||||
def update_config(self):
|
||||
if not isinstance(self.persisted, ConfigFileAccess):
|
||||
raise TypeError("Config file cannot be updated.")
|
||||
self._updating_config = True
|
||||
yield self
|
||||
self._updating_config = False
|
||||
self.persisted.save()
|
||||
if isinstance(self.persisted, ConfigFileAccess):
|
||||
self.persisted.save()
|
||||
|
||||
@property
|
||||
def modify_order(self):
|
||||
|
|
|
@ -1045,6 +1045,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
|||
(dict) Dictionary with key/value of new preference
|
||||
"""
|
||||
account = self.get_account_or_default(account_id)
|
||||
if value and isinstance(value, str) and value[0] in ('[', '{'):
|
||||
value = json.loads(value)
|
||||
account.preferences[key] = value
|
||||
account.modified_on = time.time()
|
||||
self.default_wallet.save()
|
||||
|
|
|
@ -78,11 +78,31 @@ class Examples(CommandTestCase):
|
|||
'Get version',
|
||||
'version'
|
||||
)
|
||||
|
||||
# settings
|
||||
|
||||
await r(
|
||||
'Get settings',
|
||||
'settings', 'get'
|
||||
)
|
||||
|
||||
await r(
|
||||
'Set settings',
|
||||
'settings', 'set', '"tcp_port"', '99'
|
||||
)
|
||||
|
||||
# preferences
|
||||
|
||||
await r(
|
||||
'Set preference',
|
||||
'preference', 'set', '"theme"', '"dark"'
|
||||
)
|
||||
|
||||
await r(
|
||||
'Get preferences',
|
||||
'preference', 'get'
|
||||
)
|
||||
|
||||
# accounts
|
||||
|
||||
await r(
|
||||
|
|
Loading…
Reference in a new issue