From 13f29a77ddc2ce9d46e91ecbee1fff5b885b8286 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Sat, 14 Aug 2010 16:05:40 +0100 Subject: [PATCH] fix the system.listMethods json call when running in classic mode --- deluge/ui/web/json_api.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index 6ec567b96..02132a113 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -110,7 +110,16 @@ class JSON(resource.Resource, component.Component): component.Component.__init__(self, "JSON") self._remote_methods = [] self._local_methods = {} - client.disconnect_callback = self._on_client_disconnect + if client.is_classicmode(): + def on_got_methods(methods): + """ + Handles receiving the method names + """ + self._remote_methods = methods + + client.daemon.get_method_list().addCallback(on_got_methods) + else: + client.disconnect_callback = self._on_client_disconnect def connect(self, host="localhost", port=58846, username="", password=""): """