fix uploading plugins when the daemon is not localhost

This commit is contained in:
Damien Churchill 2009-12-10 17:35:35 +00:00
parent 2840d43ccb
commit 9e9fbd6242
2 changed files with 4 additions and 3 deletions

View file

@ -17,6 +17,7 @@
torrent creation
* Fix crash in Windows when creating a torrent
* Add button to Other preferences to associate magnet links with Deluge
* Fix uploading plugins when the daemon is not localhost
==== Console ====
* Fix using the console in Windows, but only in command-line mode

View file

@ -932,6 +932,7 @@ class Preferences(component.Component):
chooser.destroy()
return
import base64
import shutil
import os.path
filename = os.path.split(filepath)[1]
@ -943,9 +944,8 @@ class Preferences(component.Component):
if not client.is_localhost():
# We need to send this plugin to the daemon
client.core.upload_plugin(
filename,
xmlrpclib.Binary(open(filepath, "rb").read()))
filedump = base64.encodestring(open(filepath, "rb").read())
client.core.upload_plugin(filename, filedump)
client.core.rescan_plugins()
chooser.destroy()