Module: deluge Branch: master Commit: 9f992ec40d28e3d1c5d63988f40a33787c77353c
Author: Damien Churchill <[email protected]> Date: Sat Aug 14 16:05:40 2010 +0100 fix the system.listMethods json call when running in classic mode --- deluge/ui/web/json_api.py | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index d49d2d5..650faf6 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=""): """ -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
