From 74134a4e1807baf28e180e5b49d63dd87f9af56d Mon Sep 17 00:00:00 2001 From: Doadin <tbkizle@gmail.com> Date: Sun, 6 Jul 2014 22:53:22 -0400 Subject: [PATCH] Replace add_torrent with async_add_torrent --- deluge/core/torrentmanager.py | 4 ++-- deluge/ui/console/modes/add_util.py | 2 +- deluge/ui/console/modes/alltorrents.py | 2 +- deluge/ui/console/modes/torrentdetail.py | 2 +- deluge/ui/gtkui/queuedtorrents.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index c762aa0..f8f98e8 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -478,7 +478,7 @@ def add(self, torrent_info=None, state=None, options=None, save_state=True, handle = None try: - handle = self.session.add_torrent(add_torrent_params) + handle = self.session.async_add_torrent(async_add_torrent_params) except RuntimeError as ex: log.warning("Error adding torrent: %s", ex) @@ -1119,7 +1119,7 @@ def on_alert_save_resume_data(self, alert): return if torrent_id in self.torrents: - # Libtorrent in add_torrent() expects resume_data to be bencoded + # Libtorrent in async_add_torrent() expects resume_data to be bencoded self.resume_data[torrent_id] = lt.bencode(alert.resume_data) if torrent_id in self.waiting_on_resume_data: diff --git a/deluge/ui/console/modes/add_util.py b/deluge/ui/console/modes/add_util.py index b741a6a..ca17328 100644 --- a/deluge/ui/console/modes/add_util.py +++ b/deluge/ui/console/modes/add_util.py @@ -61,7 +61,7 @@ def __bracket_fixup(path): newpath = newpath.replace(unichr(sentinal),"[]]") return newpath -def add_torrent(t_file, options, success_cb, fail_cb, ress): +def async_add_torrent(t_file, options, success_cb, fail_cb, ress): t_options = {} if options["path"]: t_options["download_location"] = os.path.expanduser(options["path"]) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index fc1f870..eb8e41d 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -45,7 +45,7 @@ from deluge.ui.sessionproxy import SessionProxy from popup import Popup, SelectablePopup, MessagePopup, ALIGN -from add_util import add_torrent +from add_util import async_add_torrent from input_popup import InputPopup, ALIGN from torrentdetail import TorrentDetail from addtorrents import AddTorrents diff --git a/deluge/ui/console/modes/torrentdetail.py b/deluge/ui/console/modes/torrentdetail.py index 095fea4..aac9499 100644 --- a/deluge/ui/console/modes/torrentdetail.py +++ b/deluge/ui/console/modes/torrentdetail.py @@ -46,7 +46,7 @@ from deluge.ui.sessionproxy import SessionProxy from popup import Popup,SelectablePopup,MessagePopup -from add_util import add_torrent +from add_util import async_add_torrent from input_popup import InputPopup import deluge.ui.console.colors as colors import format_utils diff --git a/deluge/ui/gtkui/queuedtorrents.py b/deluge/ui/gtkui/queuedtorrents.py index 7eeaaa7..28fbf7d 100644 --- a/deluge/ui/gtkui/queuedtorrents.py +++ b/deluge/ui/gtkui/queuedtorrents.py @@ -172,11 +172,11 @@ def on_button_close_clicked(self, widget): def on_button_add_clicked(self, widget): # Add all the torrents in the liststore - def add_torrent(model, path, iter, data): + def async_add_torrent(model, path, iter, data): torrent_path = model.get_value(iter, 1).decode('utf-8') process_args([torrent_path]) - self.liststore.foreach(add_torrent, None) + self.liststore.foreach(async_add_torrent, None) del self.queue[:] self.dialog.hide() self.update_status_bar() -- 1.9.3