mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
[Py2to3] Fix putChild requires bytes
This commit is contained in:
parent
dc8766874e
commit
bc2f4a30eb
2 changed files with 14 additions and 13 deletions
|
@ -155,7 +155,8 @@ class WebAPITestCase(WebServerTestBase):
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def test_download_torrent_from_url(self):
|
def test_download_torrent_from_url(self):
|
||||||
filename = 'ubuntu-9.04-desktop-i386.iso.torrent'
|
filename = 'ubuntu-9.04-desktop-i386.iso.torrent'
|
||||||
self.deluge_web.top_level.putChild(filename, File(common.get_test_data_file(filename)))
|
self.deluge_web.top_level.putChild(
|
||||||
|
filename.encode(), File(common.get_test_data_file(filename)))
|
||||||
url = 'http://localhost:%d/%s' % (self.webserver_listen_port, filename)
|
url = 'http://localhost:%d/%s' % (self.webserver_listen_port, filename)
|
||||||
res = yield self.deluge_web.web_api.download_torrent_from_url(url)
|
res = yield self.deluge_web.web_api.download_torrent_from_url(url)
|
||||||
self.assertTrue(res.endswith(filename))
|
self.assertTrue(res.endswith(filename))
|
||||||
|
|
|
@ -444,17 +444,17 @@ class TopLevel(resource.Resource):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
resource.Resource.__init__(self)
|
resource.Resource.__init__(self)
|
||||||
|
|
||||||
self.putChild('css', LookupResource('Css', rpath('css')))
|
self.putChild(b'css', LookupResource('Css', rpath('css')))
|
||||||
if os.path.isfile(rpath('js', 'gettext.js')):
|
if os.path.isfile(rpath('js', 'gettext.js')):
|
||||||
self.putChild('gettext.js', GetText())
|
self.putChild(b'gettext.js', GetText())
|
||||||
else:
|
else:
|
||||||
log.warning(
|
log.warning(
|
||||||
'Cannot find "gettext.js" translation file!'
|
'Cannot find "gettext.js" translation file!'
|
||||||
' Text will only be available in English.')
|
' Text will only be available in English.')
|
||||||
self.putChild('gettext.js', MockGetText())
|
self.putChild(b'gettext.js', MockGetText())
|
||||||
self.putChild('flag', Flag())
|
self.putChild(b'flag', Flag())
|
||||||
self.putChild('icons', LookupResource('Icons', rpath('icons')))
|
self.putChild(b'icons', LookupResource('Icons', rpath('icons')))
|
||||||
self.putChild('images', LookupResource('Images', rpath('images')))
|
self.putChild(b'images', LookupResource('Images', rpath('images')))
|
||||||
|
|
||||||
js = ScriptResource()
|
js = ScriptResource()
|
||||||
|
|
||||||
|
@ -477,12 +477,12 @@ class TopLevel(resource.Resource):
|
||||||
js.add_script('deluge-all.js', rpath('js', 'deluge-all.js'))
|
js.add_script('deluge-all.js', rpath('js', 'deluge-all.js'))
|
||||||
|
|
||||||
self.js = js
|
self.js = js
|
||||||
self.putChild('js', js)
|
self.putChild(b'js', js)
|
||||||
self.putChild('json', JSON())
|
self.putChild(b'json', JSON())
|
||||||
self.putChild('upload', Upload())
|
self.putChild(b'upload', Upload())
|
||||||
self.putChild('render', Render())
|
self.putChild(b'render', Render())
|
||||||
self.putChild('themes', static.File(rpath('themes')))
|
self.putChild(b'themes', static.File(rpath('themes')))
|
||||||
self.putChild('tracker', Tracker())
|
self.putChild(b'tracker', Tracker())
|
||||||
|
|
||||||
theme = component.get('DelugeWeb').config['theme']
|
theme = component.get('DelugeWeb').config['theme']
|
||||||
if not os.path.isfile(rpath('themes', 'css', 'xtheme-%s.css' % theme)):
|
if not os.path.isfile(rpath('themes', 'css', 'xtheme-%s.css' % theme)):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue