From c6439e5a224ac104ec246fbb4e206cc52b864572 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 30 Jan 2009 14:09:22 +0000 Subject: [PATCH] add a list_methods method so a javascript json-client can be built for the webui --- deluge/core/rpcserver.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deluge/core/rpcserver.py b/deluge/core/rpcserver.py index 34f2a515b..c4ad6bfd1 100644 --- a/deluge/core/rpcserver.py +++ b/deluge/core/rpcserver.py @@ -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: