mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 20:14:51 +00:00
add a list_methods method so a javascript json-client can be built for
the webui
This commit is contained in:
parent
b3b856bcca
commit
c6439e5a22
1 changed files with 14 additions and 0 deletions
|
@ -199,6 +199,20 @@ class DelugeRPCProtocol(Protocol):
|
|||
self.transport.loseConnection()
|
||||
finally:
|
||||
return
|
||||
elif method == "daemon.list_methods":
|
||||
# This is a method used to populate the json-rpc interface in the
|
||||
# webui
|
||||
try:
|
||||
ret = self.factory.methods.keys()
|
||||
except Exception, e:
|
||||
# Send error packet here
|
||||
log.exception(e)
|
||||
else:
|
||||
self.sendData((RPC_RESPONSE, request_id, (ret)))
|
||||
if not ret:
|
||||
self.transport.loseConnection()
|
||||
finally:
|
||||
return
|
||||
|
||||
if method in self.factory.methods:
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue