mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Merge branch 'master' of deluge-torrent.org:deluge
This commit is contained in:
commit
2531271fe2
6 changed files with 28 additions and 6 deletions
|
@ -110,6 +110,14 @@ class Core(CorePluginBase):
|
||||||
else:
|
else:
|
||||||
save_path = info["save_path"]
|
save_path = info["save_path"]
|
||||||
|
|
||||||
|
# getProcessOutputAndValue requires args to be str
|
||||||
|
if isinstance(torrent_name, unicode):
|
||||||
|
torrent_id = torrent_id.encode("utf-8", "ignore")
|
||||||
|
if isinstance(torrent_name, unicode):
|
||||||
|
torrent_name = torrent_name.encode("utf-8", "ignore")
|
||||||
|
if isinstance(save_path, unicode):
|
||||||
|
save_path = save_path.encode("utf-8", "ignore")
|
||||||
|
|
||||||
log.debug("[execute] Running commands for %s", event)
|
log.debug("[execute] Running commands for %s", event)
|
||||||
|
|
||||||
def log_error(result, command):
|
def log_error(result, command):
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 5.3 KiB |
|
@ -5,7 +5,11 @@ from twisted.trial import unittest
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
from twisted.python.failure import Failure
|
from twisted.python.failure import Failure
|
||||||
from twisted.web.http import FORBIDDEN, NOT_MODIFIED
|
from twisted.web.http import FORBIDDEN, NOT_MODIFIED
|
||||||
from twisted.web.resource import Resource, ForbiddenResource
|
try:
|
||||||
|
from twisted.web.resource import Resource, ForbiddenResource
|
||||||
|
except ImportError:
|
||||||
|
# twisted 8
|
||||||
|
from twisted.web.error import Resource, ForbiddenResource
|
||||||
from twisted.web.server import Site
|
from twisted.web.server import Site
|
||||||
|
|
||||||
from deluge.httpdownloader import download_file
|
from deluge.httpdownloader import download_file
|
||||||
|
|
|
@ -405,7 +405,11 @@ Please see the details below for more information."), details=traceback.format_e
|
||||||
|
|
||||||
if self.config["show_connection_manager_on_start"]:
|
if self.config["show_connection_manager_on_start"]:
|
||||||
# XXX: We need to call a simulate() here, but this could be a bug in twisted
|
# XXX: We need to call a simulate() here, but this could be a bug in twisted
|
||||||
reactor.simulate()
|
try:
|
||||||
|
reactor._simulate()
|
||||||
|
except AttributeError:
|
||||||
|
# twisted < 12
|
||||||
|
reactor.simulate()
|
||||||
self.connectionmanager.show()
|
self.connectionmanager.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,12 @@ from urlparse import urljoin, urlparse
|
||||||
from tempfile import mkstemp
|
from tempfile import mkstemp
|
||||||
|
|
||||||
from twisted.internet import defer, threads
|
from twisted.internet import defer, threads
|
||||||
from twisted.web import error
|
from twisted.web.error import PageRedirect
|
||||||
|
try:
|
||||||
|
from twisted.web.resource import NoResource, ForbiddenResource
|
||||||
|
except ImportError:
|
||||||
|
# twisted 8
|
||||||
|
from twisted.web.error import NoResource, ForbiddenResource
|
||||||
|
|
||||||
from deluge.component import Component
|
from deluge.component import Component
|
||||||
from deluge.configmanager import get_config_dir
|
from deluge.configmanager import get_config_dir
|
||||||
|
@ -238,7 +243,7 @@ class TrackerIcons(Component):
|
||||||
error_msg = f.getErrorMessage()
|
error_msg = f.getErrorMessage()
|
||||||
log.debug("Error downloading page: %s", error_msg)
|
log.debug("Error downloading page: %s", error_msg)
|
||||||
d = f
|
d = f
|
||||||
if f.check(error.PageRedirect):
|
if f.check(PageRedirect):
|
||||||
# Handle redirect errors
|
# Handle redirect errors
|
||||||
location = urljoin(self.host_to_url(host), error_msg.split(" to ")[1])
|
location = urljoin(self.host_to_url(host), error_msg.split(" to ")[1])
|
||||||
self.redirects[host] = url_to_host(location)
|
self.redirects[host] = url_to_host(location)
|
||||||
|
@ -378,14 +383,14 @@ class TrackerIcons(Component):
|
||||||
error_msg = f.getErrorMessage()
|
error_msg = f.getErrorMessage()
|
||||||
log.debug("Error downloading icon: %s", error_msg)
|
log.debug("Error downloading icon: %s", error_msg)
|
||||||
d = f
|
d = f
|
||||||
if f.check(error.PageRedirect):
|
if f.check(PageRedirect):
|
||||||
# Handle redirect errors
|
# Handle redirect errors
|
||||||
location = urljoin(self.host_to_url(host), error_msg.split(" to ")[1])
|
location = urljoin(self.host_to_url(host), error_msg.split(" to ")[1])
|
||||||
d = self.download_icon([(location, extension_to_mimetype(location.rpartition('.')[2]))] + icons, host)
|
d = self.download_icon([(location, extension_to_mimetype(location.rpartition('.')[2]))] + icons, host)
|
||||||
if not icons:
|
if not icons:
|
||||||
d.addCallbacks(self.on_download_icon_complete, self.on_download_icon_fail,
|
d.addCallbacks(self.on_download_icon_complete, self.on_download_icon_fail,
|
||||||
callbackArgs=(host,), errbackArgs=(host,))
|
callbackArgs=(host,), errbackArgs=(host,))
|
||||||
elif f.check(error.NoResource, error.ForbiddenResource) and icons:
|
elif f.check(NoResource, ForbiddenResource) and icons:
|
||||||
d = self.download_icon(icons, host)
|
d = self.download_icon(icons, host)
|
||||||
elif f.check(NoIconsError, HTMLParseError):
|
elif f.check(NoIconsError, HTMLParseError):
|
||||||
# No icons, try favicon.ico as an act of desperation
|
# No icons, try favicon.ico as an act of desperation
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -70,6 +70,7 @@ _extra_compile_args = [
|
||||||
"-DTORRENT_USE_OPENSSL=1",
|
"-DTORRENT_USE_OPENSSL=1",
|
||||||
"-DBOOST_FILESYSTEM_VERSION=2",
|
"-DBOOST_FILESYSTEM_VERSION=2",
|
||||||
"-DBOOST_ASIO_ENABLE_CANCELIO",
|
"-DBOOST_ASIO_ENABLE_CANCELIO",
|
||||||
|
"-DBOOST_ASIO_SEPARATE_COMPILATION",
|
||||||
"-O2",
|
"-O2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue