summaryrefslogtreecommitdiffstats
path: root/deluge/ui
diff options
context:
space:
mode:
authorDamien Churchill <damoc@gmail.com>2009-08-20 00:27:34 +0000
committerDamien Churchill <damoc@gmail.com>2009-08-20 00:27:34 +0000
commit7d0ccb8847acf8e755274eed3d290b78e35956de (patch)
tree1ce94c8b7e7ba9a74c08a3c3b6011a3ea2253493 /deluge/ui
parentea3f8b7d34ee31127c101ed67fec7e6efa0327a6 (diff)
downloaddeluge-7d0ccb8847acf8e755274eed3d290b78e35956de.tar.gz
deluge-7d0ccb8847acf8e755274eed3d290b78e35956de.tar.bz2
deluge-7d0ccb8847acf8e755274eed3d290b78e35956de.zip
fix returning the call when the method doesn't return a deferred
Diffstat (limited to 'deluge/ui')
-rw-r--r--deluge/ui/web/json_api.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py
index 6245ab9d8..3bb2d277b 100644
--- a/deluge/ui/web/json_api.py
+++ b/deluge/ui/web/json_api.py
@@ -233,6 +233,7 @@ class JSON(resource.Resource, component.Component):
d.addErrback(self._on_rpc_request_failed, response, request)
return d
else:
+ response["result"] = d
return self._send_response(request, response)
def _on_json_request_failed(self, reason, request):
@@ -702,10 +703,23 @@ class WebApi(JSONComponent):
:rtype: dictionary
:returns: the configuration
"""
-
config = component.get("DelugeWeb").config.config.copy()
del config["sessions"]
del config["pwd_salt"]
del config["pwd_sha1"]
return config
- \ No newline at end of file
+
+
+ @export
+ def set_config(self, config):
+ """
+ Sets the configuration dictionary for the web interface.
+
+ :param config: The configuration options to update
+ :type config: dictionary
+ """
+ web_config = component.get("DelugeWeb").config
+ for key in config.keys():
+ if isinstance(config[key], unicode) or isinstance(config[key], str):
+ config[key] = config[key].encode("utf8")
+ web_config[key] = config[key] \ No newline at end of file