From 15517732aed696f99cf96ff49502d21feb61beb3 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Thu, 16 Mar 2017 17:48:28 -0400 Subject: [PATCH 01/10] add config to disable reflecting on publish --- CHANGELOG.md | 1 + lbrynet/conf.py | 2 +- lbrynet/lbryfilemanager/EncryptedFileManager.py | 4 +++- lbrynet/lbrynet_daemon/Daemon.py | 7 ++++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6ae1468b..99d7cb0f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ at anytime. ## [Unreleased] ### Added * publish API command can take metadata fields as arguments + * Added `reflect_uploads` config to disable reflecting on upload * * diff --git a/lbrynet/conf.py b/lbrynet/conf.py index 76ac1623a..1dc2b6b3c 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -192,7 +192,7 @@ ADJUSTABLE_SETTINGS = { 'peer_port': (int, 3333), 'pointtrader_server': (str, 'http://127.0.0.1:2424'), 'reflector_port': (int, 5566), - 'reflector_reupload': (bool, True), + 'reflect_uploads': (bool, True), 'reflector_servers': (list, [('reflector.lbry.io', 5566)], server_port), 'run_on_startup': (bool, False), 'run_reflector_server': (bool, False), diff --git a/lbrynet/lbryfilemanager/EncryptedFileManager.py b/lbrynet/lbryfilemanager/EncryptedFileManager.py index a6a68a11c..4dbf3dd60 100644 --- a/lbrynet/lbryfilemanager/EncryptedFileManager.py +++ b/lbrynet/lbryfilemanager/EncryptedFileManager.py @@ -17,6 +17,7 @@ from lbrynet.lbryfile.StreamDescriptor import EncryptedFileStreamType from lbrynet.cryptstream.client.CryptStreamDownloader import AlreadyStoppedError from lbrynet.cryptstream.client.CryptStreamDownloader import CurrentlyStoppingError from lbrynet.core.sqlite_helpers import rerun_if_locked +from lbrynet.conf import settings log = logging.getLogger(__name__) @@ -57,7 +58,8 @@ class EncryptedFileManager(object): yield self._open_db() yield self._add_to_sd_identifier() yield self._start_lbry_files() - safe_start_looping_call(self.lbry_file_reflector) + if settings['reflect_uploads']: + safe_start_looping_call(self.lbry_file_reflector) def get_lbry_file_status(self, lbry_file): return self._get_lbry_file_status(lbry_file.rowid) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 881fe55ae..34d81ea4f 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -820,9 +820,10 @@ class Daemon(AuthJSONRPCServer): claim_out = yield publisher.update_stream(name, bid, metadata) else: claim_out = yield publisher.publish_stream(name, file_path, bid, metadata) - d = reupload.reflect_stream(publisher.lbry_file) - d.addCallbacks(lambda _: log.info("Reflected new publication to lbry://%s", name), - log.exception) + if conf.settings['reflect_uploads']: + d = reupload.reflect_stream(publisher.lbry_file) + d.addCallbacks(lambda _: log.info("Reflected new publication to lbry://%s", name), + log.exception) log.info("Success! Published to lbry://%s txid: %s nout: %d", name, claim_out['txid'], claim_out['nout']) yield self._add_to_pending_claims(claim_out, name) From b00c20180be9f0e92ebfb2087dc98bcbc0183ed0 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Thu, 16 Mar 2017 17:56:25 -0400 Subject: [PATCH 02/10] =?UTF-8?q?Bump=20version:=200.9.1rc4=20=E2=86=92=20?= =?UTF-8?q?0.9.1rc5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- CHANGELOG.md | 15 +++++++++++---- lbrynet/__init__.py | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2403b07bd..7609126db 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.9.1rc4 +current_version = 0.9.1rc5 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)((?P[a-z]+)(?P\d+))? diff --git a/CHANGELOG.md b/CHANGELOG.md index 99d7cb0f4..1d1b2390c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,7 @@ at anytime. ## [Unreleased] ### Added - * publish API command can take metadata fields as arguments - * Added `reflect_uploads` config to disable reflecting on upload + * * * @@ -20,9 +19,17 @@ at anytime. * ### Fixed - * Fixed jsonrpc_reflect() - * Fixed api help return * + * + * + +## [0.9.1rc5] - 2017-03-16 +### Added + * publish API command can take metadata fields as arguments + * Added `reflect_uploads` config to disable reflecting on upload +### Fixed + * Fixed jsonrpc_reflect() + * Fixed api help return ## [0.9.1rc2] - 2017-03-15 ### Added diff --git a/lbrynet/__init__.py b/lbrynet/__init__.py index d50eb6e41..0899ca125 100644 --- a/lbrynet/__init__.py +++ b/lbrynet/__init__.py @@ -1,6 +1,6 @@ import logging -__version__ = "0.9.1rc4" +__version__ = "0.9.1rc5" version = tuple(__version__.split('.')) logging.getLogger(__name__).addHandler(logging.NullHandler()) From 6482619faca0a88532f14127566c1cdd3efb41d2 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Fri, 17 Mar 2017 13:07:18 -0400 Subject: [PATCH 03/10] stupid bug --- lbrynet/lbryfilemanager/EncryptedFileManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lbrynet/lbryfilemanager/EncryptedFileManager.py b/lbrynet/lbryfilemanager/EncryptedFileManager.py index 4dbf3dd60..4cba9d80d 100644 --- a/lbrynet/lbryfilemanager/EncryptedFileManager.py +++ b/lbrynet/lbryfilemanager/EncryptedFileManager.py @@ -17,7 +17,7 @@ from lbrynet.lbryfile.StreamDescriptor import EncryptedFileStreamType from lbrynet.cryptstream.client.CryptStreamDownloader import AlreadyStoppedError from lbrynet.cryptstream.client.CryptStreamDownloader import CurrentlyStoppingError from lbrynet.core.sqlite_helpers import rerun_if_locked -from lbrynet.conf import settings +from lbrynet import conf log = logging.getLogger(__name__) @@ -58,7 +58,7 @@ class EncryptedFileManager(object): yield self._open_db() yield self._add_to_sd_identifier() yield self._start_lbry_files() - if settings['reflect_uploads']: + if conf.settings['reflect_uploads']: safe_start_looping_call(self.lbry_file_reflector) def get_lbry_file_status(self, lbry_file): From ee77bb0670b2eda7188557d7772f6f12abe49f88 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Fri, 17 Mar 2017 13:10:40 -0400 Subject: [PATCH 04/10] unused imports --- scripts/encrypt_blob.py | 2 -- scripts/query_available_blobs.py | 11 ----------- 2 files changed, 13 deletions(-) diff --git a/scripts/encrypt_blob.py b/scripts/encrypt_blob.py index 3408f9023..440ea7a8d 100644 --- a/scripts/encrypt_blob.py +++ b/scripts/encrypt_blob.py @@ -2,7 +2,6 @@ import argparse import binascii import logging -import os import StringIO import sys @@ -11,7 +10,6 @@ from twisted.internet import reactor from lbrynet import conf from lbrynet.cryptstream import CryptBlob -from lbrynet.core import HashBlob from lbrynet.core import log_support from lbrynet.core import cryptoutils diff --git a/scripts/query_available_blobs.py b/scripts/query_available_blobs.py index 61445f4ba..727c019c8 100644 --- a/scripts/query_available_blobs.py +++ b/scripts/query_available_blobs.py @@ -3,7 +3,6 @@ from lbrynet.core import log_support import argparse import collections -import itertools import logging import os import random @@ -11,25 +10,15 @@ import shutil import sys import tempfile -import appdirs from twisted.internet import defer from twisted.internet import reactor -from twisted.internet import protocol -from twisted.internet import endpoints from lbrynet import analytics from lbrynet import conf -from lbrynet.core import Error from lbrynet.core import Wallet from lbrynet.core import BlobAvailability -from lbrynet.core import HashAnnouncer -from lbrynet.core import PeerManager from lbrynet.core import Session from lbrynet.core import utils -from lbrynet.core.client import DHTPeerFinder -from lbrynet.dht import node -from lbrynet.metadata import Metadata -from lbrynet.core import StreamDescriptor as sd import common import name From a4de0056ab042d93c369684a5c5470a26fd638eb Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Fri, 17 Mar 2017 13:11:38 -0400 Subject: [PATCH 05/10] =?UTF-8?q?Bump=20version:=200.9.1rc5=20=E2=86=92=20?= =?UTF-8?q?0.9.1rc6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- lbrynet/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 7609126db..41a6c7dc2 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.9.1rc5 +current_version = 0.9.1rc6 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)((?P[a-z]+)(?P\d+))? diff --git a/lbrynet/__init__.py b/lbrynet/__init__.py index 0899ca125..f36fc0620 100644 --- a/lbrynet/__init__.py +++ b/lbrynet/__init__.py @@ -1,6 +1,6 @@ import logging -__version__ = "0.9.1rc5" +__version__ = "0.9.1rc6" version = tuple(__version__.split('.')) logging.getLogger(__name__).addHandler(logging.NullHandler()) From 4edd13f4f4cbdd390dd6b19d5446e81ef01e64f4 Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Fri, 17 Mar 2017 15:07:18 -0400 Subject: [PATCH 06/10] fix wallet_public_key API command --- CHANGELOG.md | 2 +- docs/index.md | 5 +++-- lbrynet/core/Wallet.py | 6 ++++-- lbrynet/lbrynet_daemon/Daemon.py | 10 ++++++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d1b2390c..763dcdc1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ at anytime. * ### Fixed - * + * Fix wallet_public_key API command * * diff --git a/docs/index.md b/docs/index.md index bc7d73f05..50a0978a3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -633,8 +633,9 @@ Returns: Get public key from wallet address Args: - 'wallet': (str) wallet address in base58 + 'address': (str) wallet address in base58 Returns: - (str) Public key in hex encoding + (list) list of public keys associated with address. + Could contain more than one public key if multisig. ``` diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index 0937498f4..edef63c4f 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -1101,8 +1101,10 @@ class LBRYumWallet(Wallet): def _address_is_mine(self, address): return self._run_cmd_as_defer_succeed('ismine', address) - def get_pub_keys(self, wallet): - return self._run_cmd_as_defer_succeed('getpubkyes', wallet) + # returns a list of public keys associated with address + # (could be multiple public keys if a multisig address) + def get_pub_keys(self, address): + return self._run_cmd_as_defer_succeed('getpubkeys', address) def _save_wallet(self, val): self.wallet.storage.write() diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 34d81ea4f..3b5410dcf 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -2052,18 +2052,20 @@ class Daemon(AuthJSONRPCServer): return self.jsonrpc_wallet_public_key(wallet) @AuthJSONRPCServer.auth_required - def jsonrpc_wallet_public_key(self, wallet): + def jsonrpc_wallet_public_key(self, address): """ Get public key from wallet address Args: - 'wallet': (str) wallet address in base58 + 'address': (str) wallet address in base58 Returns: - (str) Public key in hex encoding + (list) list of public keys associated with address. + Could contain more than one public key if multisig. """ - d = self.session.wallet.get_pub_keys(wallet) + d = self.session.wallet.get_pub_keys(address) d.addCallback(lambda r: self._render_response(r)) + return d @AuthJSONRPCServer.auth_required def jsonrpc_get_new_address(self): From c422b5252e7ff4f20e8687b2936f086eed7842fa Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Fri, 17 Mar 2017 18:24:20 -0400 Subject: [PATCH 07/10] =?UTF-8?q?Bump=20version:=200.9.1rc6=20=E2=86=92=20?= =?UTF-8?q?0.9.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- CHANGELOG.md | 6 +++++- lbrynet/__init__.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 41a6c7dc2..45fd93f17 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.9.1rc6 +current_version = 0.9.1 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)((?P[a-z]+)(?P\d+))? diff --git a/CHANGELOG.md b/CHANGELOG.md index 763dcdc1a..b52e300e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,9 +19,13 @@ at anytime. * ### Fixed - * Fix wallet_public_key API command * * + * + +## [0.9.1] - 2017-03-17 +### Fixed + * Fix wallet_public_key API command ## [0.9.1rc5] - 2017-03-16 ### Added diff --git a/lbrynet/__init__.py b/lbrynet/__init__.py index f36fc0620..3d613ea02 100644 --- a/lbrynet/__init__.py +++ b/lbrynet/__init__.py @@ -1,6 +1,6 @@ import logging -__version__ = "0.9.1rc6" +__version__ = "0.9.1" version = tuple(__version__.split('.')) logging.getLogger(__name__).addHandler(logging.NullHandler()) From a95c49bd08795af98afac751ccc3dc0903122bac Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sun, 19 Mar 2017 10:51:39 -0400 Subject: [PATCH 08/10] add wallet_list --- CHANGELOG.md | 2 +- lbrynet/core/Wallet.py | 3 +++ lbrynet/lbrynet_daemon/Daemon.py | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b52e300e0..73d0f0ab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ at anytime. ## [Unreleased] ### Added - * + * Add `wallet_list` command * * diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index edef63c4f..11a30a05f 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -1106,6 +1106,9 @@ class LBRYumWallet(Wallet): def get_pub_keys(self, address): return self._run_cmd_as_defer_succeed('getpubkeys', address) + def list_addresses(self): + return self._run_cmd_as_defer_succeed('listaddresses') + def _save_wallet(self, val): self.wallet.storage.write() return defer.succeed(val) diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 3b5410dcf..e72f2aaed 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -2067,6 +2067,22 @@ class Daemon(AuthJSONRPCServer): d.addCallback(lambda r: self._render_response(r)) return d + @AuthJSONRPCServer.auth_required + @defer.inlineCallbacks + def jsonrpc_wallet_list(self): + """ + List wallet addresses + + Args: + None + Returns: + List of wallet addresses + """ + + addresses = yield self.session.wallet.list_addresses() + response = yield self._render_response(addresses) + defer.returnValue(response) + @AuthJSONRPCServer.auth_required def jsonrpc_get_new_address(self): """ From 85845414b8c43458a09c834aa64c2944189c2529 Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Mon, 20 Mar 2017 13:41:32 -0400 Subject: [PATCH 09/10] format help message properly in case of error in CLI --- lbrynet/lbrynet_daemon/DaemonCLI.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lbrynet/lbrynet_daemon/DaemonCLI.py b/lbrynet/lbrynet_daemon/DaemonCLI.py index 18b7682bd..fd3bd9ad4 100644 --- a/lbrynet/lbrynet_daemon/DaemonCLI.py +++ b/lbrynet/lbrynet_daemon/DaemonCLI.py @@ -64,8 +64,7 @@ def main(): os.path.basename(sys.argv[0])) ) else: - help_response = api.call('help', params) - print help_response['help'] if 'help' in help_response else help_response + print_help_response(api.call('help', params)) elif method not in api.commands(): print_error("'" + method + "' is not a valid command.") @@ -84,13 +83,16 @@ def main(): # instead of this generic message. # https://app.asana.com/0/158602294500137/200173944358192 print "Something went wrong, here's the usage for %s:" % method - print api.call('help', {'command': method}) + print_help_response(api.call('help', {'command': method})) if hasattr(err, 'msg'): print "Here's the traceback for the error you encountered:" print err.msg return 1 +def print_help_response(help_response): + print help_response['help'] if 'help' in help_response else help_response + def guess_type(x): if '.' in x: try: From 8f3b53197f01c38b074e78918d85d72bebab40ef Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Mon, 20 Mar 2017 15:36:40 -0400 Subject: [PATCH 10/10] dont add expected payment when payment rate is 0 --- CHANGELOG.md | 2 +- lbrynet/analytics/api.py | 7 ++-- lbrynet/core/server/BlobRequestHandler.py | 9 ++--- lbrynet/lbrynet_daemon/Daemon.py | 41 +++++------------------ 4 files changed, 18 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73d0f0ab2..062c7a5cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ at anytime. * ### Changed - * + * Dont add expected payment to wallet when payment rate is 0 * * diff --git a/lbrynet/analytics/api.py b/lbrynet/analytics/api.py index 546f93b30..67381c8e4 100644 --- a/lbrynet/analytics/api.py +++ b/lbrynet/analytics/api.py @@ -19,9 +19,10 @@ def log_response(fn): elif future.exception(): exc, traceback = future.exception_info() log.warning('Failed to send an analytics event', exc_info=(type(exc), exc, traceback)) - else: - response = future.result() - log.debug('Response (%s): %s', response.status_code, response.content) + # GRIN TURNED THIS OFF. Segment only has one response: {"success": true} + # else: + # response = future.result() + # log.debug('Response (%s): %s', response.status_code, response.content) @functools.wraps(fn) def wrapper(*args, **kwargs): diff --git a/lbrynet/core/server/BlobRequestHandler.py b/lbrynet/core/server/BlobRequestHandler.py index a47985bd8..4cce9fb59 100644 --- a/lbrynet/core/server/BlobRequestHandler.py +++ b/lbrynet/core/server/BlobRequestHandler.py @@ -5,12 +5,10 @@ from twisted.protocols.basic import FileSender from twisted.python.failure import Failure from zope.interface import implements - from lbrynet.core.Offer import Offer from lbrynet import analytics from lbrynet.interfaces import IQueryHandlerFactory, IQueryHandler, IBlobSender - log = logging.getLogger(__name__) @@ -212,11 +210,14 @@ class BlobRequestHandler(object): def set_expected_payment(): log.debug("Setting expected payment") - if self.blob_bytes_uploaded != 0 and self.blob_data_payment_rate is not None: + if ( + self.blob_bytes_uploaded != 0 and self.blob_data_payment_rate is not None + and self.blob_data_payment_rate > 0 + ): # TODO: explain why 2**20 self.wallet.add_expected_payment(self.peer, self.currently_uploading.length * 1.0 * - self.blob_data_payment_rate / 2**20) + self.blob_data_payment_rate / 2 ** 20) self.blob_bytes_uploaded = 0 self.peer.update_stats('blobs_uploaded', 1) return None diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index e72f2aaed..1584ea38c 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -1264,29 +1264,11 @@ class Daemon(AuthJSONRPCServer): """ Get daemon settings - Args: - None Returns: (dict) Dictionary of daemon settings - { - 'run_on_startup': (bool) currently not supported - 'data_rate': (float) data rate - 'max_key_fee': (float) maximum key fee - 'download_directory': (str) path of where files are downloaded - 'max_upload': (float), currently not supported - 'max_download': (float), currently not supported - 'download_timeout': (int) download timeout in seconds - 'max_search_results': (int) max search results - 'wallet_type': (str) wallet type - 'delete_blobs_on_remove': (bool) delete blobs on removal - 'peer_port': (int) peer port - 'dht_node_port': (int) dht node port - 'use_upnp': (bool) use upnp if true - } + See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of settings """ - - log.info("Get daemon settings") - return self._render_response(conf.settings.get_current_settings_dict()) + return self._render_response(conf.settings.get_adjustable_settings_dict()) @AuthJSONRPCServer.auth_required def jsonrpc_set_settings(self, **kwargs): @@ -1296,6 +1278,7 @@ class Daemon(AuthJSONRPCServer): return self.jsonrpc_settings_set(**kwargs) @AuthJSONRPCServer.auth_required + @defer.inlineCallbacks def jsonrpc_settings_set(self, **kwargs): """ Set daemon settings @@ -1308,22 +1291,14 @@ class Daemon(AuthJSONRPCServer): 'max_upload': (float), currently not supported 'max_download': (float), currently not supported 'download_timeout': (int) download timeout in seconds + 'search_timeout': (float) search timeout in seconds + 'cache_time': (int) cache timeout in seconds Returns: - (dict) settings dict + (dict) Updated dictionary of daemon settings """ - def _log_settings_change(): - log.info( - "Set daemon settings to %s", - json.dumps(conf.settings.get_adjustable_settings_dict())) - - d = self._update_settings(kwargs) - d.addErrback(lambda err: log.info(err.getTraceback())) - d.addCallback(lambda _: _log_settings_change()) - d.addCallback( - lambda _: self._render_response(conf.settings.get_adjustable_settings_dict())) - - return d + yield self._update_settings(kwargs) + defer.returnValue(conf.settings.get_adjustable_settings_dict()) def jsonrpc_help(self, command=None): """