Fix adding torrents with a unicode save_path.

This commit is contained in:
Andrew Resch 2007-10-06 04:35:15 +00:00
parent 94fd3c0f37
commit 8f6029219d
4 changed files with 13 additions and 4 deletions

View File

@ -187,6 +187,6 @@ def pythonize(var):
)
for klass in [unicode, str, bool, int, float, long]:
if isinstance(var,klass):
if isinstance(var, klass):
return klass(var)
return var

View File

@ -113,7 +113,7 @@ class Config:
"""Set the 'key' with 'value'."""
# Sets the "key" with "value" in the config dict
if self.config[key] != value:
log.debug("Setting '%s' to %s", key, value)
log.debug("Setting '%s' to %s of type %s", key, type(value), value)
self.config[key] = value
# Run the set_function for this key if any
try:
@ -128,7 +128,7 @@ class Config:
# invalid
try:
value = self.config[key]
log.debug("Getting '%s' as %s", key, value)
log.debug("Getting '%s' as %s of type %s", key, value, type(value))
return value
except KeyError:
log.warning("Key does not exist, returning None")

View File

@ -173,7 +173,7 @@ class TorrentManager:
try:
handle = self.session.add_torrent(
lt.torrent_info(torrent_filedump),
save_path,
str(save_path),
resume_data=fastresume,
compact_mode=compact,
paused=paused)

View File

@ -32,13 +32,22 @@
# statement from all source files in the program, then also delete it here.
import deluge.pluginmanagerbase
import deluge.ui.functions as functions
from deluge.configmanager import ConfigManager
from deluge.log import LOG as log
class PluginManager(deluge.pluginmanagerbase.PluginManagerBase):
def __init__(self, gtkui):
self.config = ConfigManager("gtkui.conf")
self._gtkui = gtkui
# Update the enabled_plugins from the core
enabled_plugins = functions.get_enabled_plugins()
enabled_plugins += self.config["enabled_plugins"]
enabled_plugins = list(set(enabled_plugins))
self.config["enabled_plugins"] = enabled_plugins
deluge.pluginmanagerbase.PluginManagerBase.__init__(
self, "gtkui.conf", "deluge.plugin.ui.gtk")