fix for peer_view

This commit is contained in:
Zach Tibbitts 2007-02-19 20:39:23 +00:00
parent e573805007
commit 903276a1d0

View File

@ -345,10 +345,10 @@ class DelugeGTK(dbus.service.Object):
self.pref.set("tcp_port_range_lower", 6881)
self.pref.set("tcp_port_range_upper", 6889)
self.pref.set("max_upload_rate", 0)
self.pref.set("max_number_uploads", 0)
self.pref.set("max_download_rate", 0)
self.pref.set("max_number_downloads", 0)
self.pref.set("max_upload_rate", -1)
self.pref.set("max_number_uploads", -1)
self.pref.set("max_download_rate", -1)
self.pref.set("max_number_downloads", -1)
default_plugins = []
for name in self.plugins.get_available_plugins():
if self.plugins.get_plugin(name)['default']:
@ -543,21 +543,6 @@ class DelugeGTK(dbus.service.Object):
#self.text_summary_compact_allocation.set_text(str(state[""]))
self.text_summary_eta.set_text(dcommon.estimate_eta(state))
elif tab == 1: #Peers List
unique_id = self.get_selected_torrent()
if self.saved_peer_info is None:
self.saved_peer_info = self.manager.get_torrent_peer_info(unique_id)
new_peer_info = self.saved_peer_info
new_ips = {}
for index in range(len(new_peer_info)):
if not new_peer_info[index]['client'] == "":
assert(new_peer_info[index]['ip'] not in new_ips.keys())
new_ips[new_peer_info[index]['ip']] = index
def biographer(model, path, iter, dictionary):
assert(model.get_value(iter, 0) not in dictionary.keys())
dictionary[model.get_value(iter, 0)] = model.get_string_from_iter(iter)
@ -575,6 +560,20 @@ class DelugeGTK(dbus.service.Object):
else:
return False
unique_id = self.get_selected_torrent()
self.saved_peer_info = self.manager.get_torrent_peer_info(unique_id)
new_peer_info = self.saved_peer_info
new_ips = {}
for index in range(len(new_peer_info)):
if not new_peer_info[index]['client'] == "":
assert(new_peer_info[index]['ip'] not in new_ips.keys())
new_ips[new_peer_info[index]['ip']] = index
while True:
data = remover_data(new_ips.keys())
self.peer_store.foreach(remover, data)