mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-11 10:59:00 +00:00
Fix adding torrents with a unicode save_path.
This commit is contained in:
parent
94fd3c0f37
commit
8f6029219d
4 changed files with 13 additions and 4 deletions
|
@ -187,6 +187,6 @@ def pythonize(var):
|
||||||
)
|
)
|
||||||
|
|
||||||
for klass in [unicode, str, bool, int, float, long]:
|
for klass in [unicode, str, bool, int, float, long]:
|
||||||
if isinstance(var,klass):
|
if isinstance(var, klass):
|
||||||
return klass(var)
|
return klass(var)
|
||||||
return var
|
return var
|
||||||
|
|
|
@ -113,7 +113,7 @@ class Config:
|
||||||
"""Set the 'key' with 'value'."""
|
"""Set the 'key' with 'value'."""
|
||||||
# Sets the "key" with "value" in the config dict
|
# Sets the "key" with "value" in the config dict
|
||||||
if self.config[key] != value:
|
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
|
self.config[key] = value
|
||||||
# Run the set_function for this key if any
|
# Run the set_function for this key if any
|
||||||
try:
|
try:
|
||||||
|
@ -128,7 +128,7 @@ class Config:
|
||||||
# invalid
|
# invalid
|
||||||
try:
|
try:
|
||||||
value = self.config[key]
|
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
|
return value
|
||||||
except KeyError:
|
except KeyError:
|
||||||
log.warning("Key does not exist, returning None")
|
log.warning("Key does not exist, returning None")
|
||||||
|
|
|
@ -173,7 +173,7 @@ class TorrentManager:
|
||||||
try:
|
try:
|
||||||
handle = self.session.add_torrent(
|
handle = self.session.add_torrent(
|
||||||
lt.torrent_info(torrent_filedump),
|
lt.torrent_info(torrent_filedump),
|
||||||
save_path,
|
str(save_path),
|
||||||
resume_data=fastresume,
|
resume_data=fastresume,
|
||||||
compact_mode=compact,
|
compact_mode=compact,
|
||||||
paused=paused)
|
paused=paused)
|
||||||
|
|
|
@ -32,13 +32,22 @@
|
||||||
# statement from all source files in the program, then also delete it here.
|
# statement from all source files in the program, then also delete it here.
|
||||||
|
|
||||||
import deluge.pluginmanagerbase
|
import deluge.pluginmanagerbase
|
||||||
|
import deluge.ui.functions as functions
|
||||||
|
from deluge.configmanager import ConfigManager
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
|
||||||
class PluginManager(deluge.pluginmanagerbase.PluginManagerBase):
|
class PluginManager(deluge.pluginmanagerbase.PluginManagerBase):
|
||||||
def __init__(self, gtkui):
|
def __init__(self, gtkui):
|
||||||
|
|
||||||
|
self.config = ConfigManager("gtkui.conf")
|
||||||
self._gtkui = gtkui
|
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__(
|
deluge.pluginmanagerbase.PluginManagerBase.__init__(
|
||||||
self, "gtkui.conf", "deluge.plugin.ui.gtk")
|
self, "gtkui.conf", "deluge.plugin.ui.gtk")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue