summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Churchill <damoxc@gmail.com>2010-08-14 16:05:40 +0100
committerDamien Churchill <damoxc@gmail.com>2010-08-14 16:05:41 +0100
commit13f29a77ddc2ce9d46e91ecbee1fff5b885b8286 (patch)
tree57c3ae6cb7e6c6b6bac3a8402b70c3370f37b1c1
parent161ad0ff0d01463f07127b9f01e0087f61f22a11 (diff)
downloaddeluge-13f29a77ddc2ce9d46e91ecbee1fff5b885b8286.tar.gz
deluge-13f29a77ddc2ce9d46e91ecbee1fff5b885b8286.tar.bz2
deluge-13f29a77ddc2ce9d46e91ecbee1fff5b885b8286.zip
fix the system.listMethods json call when running in classic mode
-rw-r--r--deluge/ui/web/json_api.py11
1 files changed, 10 insertions, 1 deletions
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=""):
"""