From 104852d47e3ad2d2792cbc082741ec793f5a6d47 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 10 Dec 2009 15:31:27 +0000 Subject: [PATCH] fix the upload_plugin method as it wasn't upgraded to deluge-rpc spec --- deluge/core/core.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/deluge/core/core.py b/deluge/core/core.py index 6b163eb65..bd767f14e 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -655,14 +655,21 @@ class Core(component.Component): self.add_torrent_file(os.path.split(target)[1], open(target, "rb").read(), options) @export - def upload_plugin(self, filename, plugin_data): + def upload_plugin(self, filename, filedump): """This method is used to upload new plugins to the daemon. It is used when connecting to the daemon remotely and installing a new plugin on the client side. 'plugin_data' is a xmlrpc.Binary object of the file data, ie, plugin_file.read()""" + try: + filedump = base64.decodestring(filedump) + except Exception, e: + log.error("There was an error decoding the filedump string!") + log.exception(e) + return + f = open(os.path.join(deluge.configmanager.get_config_dir(), "plugins", filename), "wb") - f.write(plugin_data.data) + f.write(filedump) f.close() component.get("CorePluginManager").scan_for_plugins()