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
@ -199,6 +199,20 @@ class DelugeRPCProtocol(Protocol):
|
|||||||
self.transport.loseConnection()
|
self.transport.loseConnection()
|
||||||
finally:
|
finally:
|
||||||
return
|
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:
|
if method in self.factory.methods:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user