add a list_methods method so a javascript json-client can be built for

the webui
This commit is contained in:
Damien Churchill 2009-01-30 14:09:22 +00:00
parent b3b856bcca
commit c6439e5a22
1 changed files with 14 additions and 0 deletions

View File

@ -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: