From 0e82847ae02891b0282d6353264f5425c59cc3fa Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sat, 5 Jan 2008 00:13:50 +0000 Subject: [PATCH] fix cast oops, add youtorrent to search, catch fastresume error --- src/core.py | 5 ++++- src/interface.py | 6 +++--- src/search.py | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/core.py b/src/core.py index f9bad3c80..6911c0942 100644 --- a/src/core.py +++ b/src/core.py @@ -412,7 +412,10 @@ class Manager: os.remove(self.unique_IDs[unique_ID].filename + ".fastresume") except: pass - deluge_core.save_fastresume(unique_ID, self.unique_IDs[unique_ID].filename) + try: + deluge_core.save_fastresume(unique_ID, self.unique_IDs[unique_ID].filename) + except: + pass else: try: os.remove(self.unique_IDs[uid].filename + ".fastresume") diff --git a/src/interface.py b/src/interface.py index fe4dd082d..9981dc619 100644 --- a/src/interface.py +++ b/src/interface.py @@ -723,7 +723,7 @@ window, please enter your password")) def torrent_view_clicked(self, widget, event): if event.button == 3: - data = self.torrent_view.get_path_at_pos(event.x, event.y) + data = self.torrent_view.get_path_at_pos(int(event.x), int(event.y)) if data is None: return True @@ -1008,8 +1008,8 @@ window, please enter your password")) seeds_t = state['total_seeds'] peers = state['num_peers'] peers_t = state['total_peers'] - dl_speed = state['download_rate'] - ul_speed = state['upload_rate'] + dl_speed = int(state['download_rate']) + ul_speed = int(state['upload_rate']) try: eta = common.get_eta(size, state["total_wanted_done"], dl_speed) diff --git a/src/search.py b/src/search.py index 73de29b9a..9793f0f82 100644 --- a/src/search.py +++ b/src/search.py @@ -38,7 +38,8 @@ class Search: self.interface = deluge_interface self.config_file = os.path.join(deluge.common.CONFIG_DIR, "newsearch.conf") self.config = deluge.pref.Preferences(self.config_file, False, - defaults={'Pirate Bay' : 'http://thepiratebay.org/search/${query}/0/7/0', + defaults={'YouTorrent': 'http://www.youtorrent.com/tag/?q=${query}', + 'Pirate Bay' : 'http://thepiratebay.org/search/${query}/0/7/0', 'Google' : "http://www.google.com/cse?cx=010331601\ 931556850092%3Apfadwhze_jy&q=${query}&sa=Search&cof=FORID%3A1", 'Mininova' : 'http://www.mininova.org/search/?search=${query}/seeds',