Author: damoxc
Revision: 6000
Log:
fix the upload_plugin method as it wasn't upgraded to deluge-rpc spec
Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog 2009-12-10 14:39:14 UTC (rev 5999)
+++ branches/1.2_RC/ChangeLog 2009-12-10 15:31:27 UTC (rev 6000)
@@ -12,7 +12,8 @@
==== GtkUI ====
* Attempt to register as the default magnet uri handler in GNOME on
startup
- * Properly show 100.00% and reduce number of progress bar updates
during a torrent creation
+ * Properly show 100.00% and reduce number of progress bar updates
during a
+ torrent creation
* Fix crash in Windows when creating a torrent
* Add button to Other preferences to associate magnet links with Deluge
@@ -23,8 +24,12 @@
* Fix #1085 only use ints for specific options to prevent unhandled
exception
==== Execute ====
- * Use the move_completed path if it is different to the save path in
the completed event.
+ * Use the move_completed path if it is different to the save path
+ in the completed event.
+==== Core =====
+ * Fix the upload_plugin rpc method (was still using XML-RPC stuff)
+
=== Deluge 1.2.0_rc4 (24 November 2009) ===
==== Core ====
* Fix deleting old .fastresume files with fresh configs
Modified: branches/1.2_RC/deluge/core/core.py
===================================================================
--- branches/1.2_RC/deluge/core/core.py 2009-12-10 14:39:14 UTC (rev 5999)
+++ branches/1.2_RC/deluge/core/core.py 2009-12-10 15:31:27 UTC (rev 6000)
@@ -655,14 +655,21 @@
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()
Modified: trunk/deluge/core/core.py
===================================================================
--- trunk/deluge/core/core.py 2009-12-10 14:39:14 UTC (rev 5999)
+++ trunk/deluge/core/core.py 2009-12-10 15:31:27 UTC (rev 6000)
@@ -655,14 +655,21 @@
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()
--
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.