Merge branch 'fix_file_seed'

* fix_file_seed:
  Ran gen_api_docs.py
  rename file_seed
This commit is contained in:
Alex Grintsvayg 2017-03-25 10:20:19 -04:00
commit b4f5f2068f
3 changed files with 25 additions and 26 deletions

View file

@ -17,6 +17,7 @@ at anytime.
### Changed ### Changed
* Removed check_pending logic from Daemon * Removed check_pending logic from Daemon
* Switched to txrequests so requests can use twisted event loop * Switched to txrequests so requests can use twisted event loop
* Renamed API command file_seed to file_set_status
* *
### Fixed ### Fixed

View file

@ -487,25 +487,9 @@ Returns:
```text ```text
Get daemon settings Get daemon settings
Args:
None
Returns: Returns:
(dict) Dictionary of daemon settings (dict) Dictionary of daemon settings
{ See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of 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
}
``` ```
## settings_set ## settings_set
@ -521,8 +505,10 @@ Args:
'max_upload': (float), currently not supported 'max_upload': (float), currently not supported
'max_download': (float), currently not supported 'max_download': (float), currently not supported
'download_timeout': (int) download timeout in seconds 'download_timeout': (int) download timeout in seconds
'search_timeout': (float) search timeout in seconds
'cache_time': (int) cache timeout in seconds
Returns: Returns:
(dict) settings dict (dict) Updated dictionary of daemon settings
``` ```
## status ## status
@ -616,6 +602,17 @@ Returns:
(bool) true, if address is associated with current wallet (bool) true, if address is associated with current wallet
``` ```
## wallet_list
```text
List wallet addresses
Args:
None
Returns:
List of wallet addresses
```
## wallet_new_address ## wallet_new_address
```text ```text

View file

@ -1467,22 +1467,22 @@ class Daemon(AuthJSONRPCServer):
@AuthJSONRPCServer.auth_required @AuthJSONRPCServer.auth_required
def jsonrpc_stop_lbry_file(self, **kwargs): def jsonrpc_stop_lbry_file(self, **kwargs):
""" """
DEPRECATED. Use `file_seed status=stop` instead. DEPRECATED. Use `file_set_status status=stop` instead.
""" """
return self.jsonrpc_file_seed(status='stop', **kwargs) return self.jsonrpc_file_set_status(status='stop', **kwargs)
@AuthJSONRPCServer.auth_required @AuthJSONRPCServer.auth_required
def jsonrpc_start_lbry_file(self, **kwargs): def jsonrpc_start_lbry_file(self, **kwargs):
""" """
DEPRECATED. Use `file_seed status=start` instead. DEPRECATED. Use `file_set_status status=start` instead.
""" """
return self.jsonrpc_file_seed(status='start', **kwargs) return self.jsonrpc_file_set_status(status='start', **kwargs)
@AuthJSONRPCServer.auth_required @AuthJSONRPCServer.auth_required
@defer.inlineCallbacks @defer.inlineCallbacks
def jsonrpc_file_seed(self, status, **kwargs): def jsonrpc_file_set_status(self, status, **kwargs):
""" """
Start or stop seeding a file Start or stop downloading a file
Args: Args:
'status': (str) "start" or "stop" 'status': (str) "start" or "stop"
@ -1503,10 +1503,11 @@ class Daemon(AuthJSONRPCServer):
if status == 'start' and lbry_file.stopped or status == 'stop' and not lbry_file.stopped: if status == 'start' and lbry_file.stopped or status == 'stop' and not lbry_file.stopped:
yield self.lbry_file_manager.toggle_lbry_file_running(lbry_file) yield self.lbry_file_manager.toggle_lbry_file_running(lbry_file)
msg = "Started seeding file" if status == 'start' else "Stopped seeding file" msg = "Started downloading file" if status == 'start' else "Stopped downloading file"
else: else:
msg = ( msg = (
"File was already being seeded" if status == 'start' else "File was already stopped" "File was already being downloaded" if status == 'start'
else "File was already stopped"
) )
response = yield self._render_response(msg) response = yield self._render_response(msg)
defer.returnValue(response) defer.returnValue(response)