just return the deferred created by httpdownloader

This commit is contained in:
Damien Churchill 2009-07-20 08:39:46 +00:00
parent a2893cc1b7
commit 3a94a33b56
1 changed files with 3 additions and 5 deletions

View File

@ -441,13 +441,11 @@ class WebApi(JSONComponent):
"""
tmp_file = os.path.join(tempfile.gettempdir(), url.split("/")[-1])
d = Deferred()
httpdownloader.download_file(url, tmp_file).addCallback(self._on_torrent_downloaded, tmp_file, d)
return d
return httpdownloader.download_file(url, tmp_file).addCallback(self._on_torrent_downloaded, tmp_file)
def _on_torrent_downloaded(self, result, filename, d):
def _on_torrent_downloaded(self, result, filename):
log.debug("filename: %s", filename)
d.callback(filename)
return filename
@export
def get_torrent_info(self, filename):