small fixes

This commit is contained in:
Alex Grintsvayg 2017-03-16 15:35:54 -04:00
parent 52d471d660
commit bfd822782d
3 changed files with 12 additions and 10 deletions

View file

@ -19,8 +19,8 @@ at anytime.
*
### Fixed
*
*
* Fixed jsonrpc_reflect()
* Fixed api help return
*
## [0.9.1rc2] - 2017-03-15

View file

@ -7,6 +7,7 @@ import base58
import requests
import urllib
import json
import textwrap
from requests import exceptions as requests_exceptions
import random
@ -1352,7 +1353,7 @@ class Daemon(AuthJSONRPCServer):
)
return self._render_response({
'help': fn.__doc__
'help': textwrap.dedent(fn.__doc__)
})
def jsonrpc_commands(self):
@ -2204,6 +2205,7 @@ class Daemon(AuthJSONRPCServer):
d.addCallback(lambda _: self._render_response("Announced"))
return d
@defer.inlineCallbacks
def jsonrpc_reflect(self, sd_hash):
"""
Reflect a stream
@ -2214,12 +2216,11 @@ class Daemon(AuthJSONRPCServer):
(bool) true if successful
"""
d = self._get_lbry_file(FileID.SD_HASH, sd_hash, return_json=False)
d.addCallback(self._reflect)
d.addCallbacks(
lambda _: self._render_response(True),
lambda err: self._render_response(err.getTraceback()))
return d
lbry_file = yield self._get_lbry_file(FileID.SD_HASH, sd_hash, return_json=False)
if lbry_file is None:
raise Exception('No file found for give sd hash')
yield reupload.reflect_stream(lbry_file)
defer.returnValue("Reflect success")
def jsonrpc_get_blob_hashes(self):
"""

View file

@ -64,7 +64,8 @@ def main():
os.path.basename(sys.argv[0]))
)
else:
print api.call('help', params).strip()
help_response = api.call('help', params)
print help_response['help'] if 'help' in help_response else help_response
elif method not in api.commands():
print_error("'" + method + "' is not a valid command.")