mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
Fix #146
This commit is contained in:
parent
622a0053d8
commit
c012427edc
2 changed files with 14 additions and 6 deletions
|
@ -245,11 +245,19 @@ class Torrent:
|
|||
except UnicodeDecodeError:
|
||||
client = str(peer.client).decode("latin-1")
|
||||
|
||||
# Make country a proper string
|
||||
country = str()
|
||||
for c in peer.country:
|
||||
if not c.isalpha():
|
||||
country += " "
|
||||
else:
|
||||
country += c
|
||||
|
||||
ret.append({
|
||||
"ip": "%s:%s" % (peer.ip[0], peer.ip[1]),
|
||||
"up_speed": peer.up_speed,
|
||||
"down_speed": peer.down_speed,
|
||||
"country": deluge.xmlrpclib.Binary(peer.country),
|
||||
"country": country,
|
||||
"client": client,
|
||||
"seed": peer.flags & peer.seed
|
||||
})
|
||||
|
|
|
@ -217,8 +217,7 @@ class PeersTab:
|
|||
client.get_torrent_status(self._on_get_torrent_status, torrent_id, ["peers"])
|
||||
|
||||
def get_flag_pixbuf(self, country):
|
||||
country = str(country)
|
||||
if not country.isalpha():
|
||||
if country == " ":
|
||||
return None
|
||||
|
||||
if not self.cached_flag_pixbufs.has_key(country):
|
||||
|
@ -266,6 +265,7 @@ class PeersTab:
|
|||
# Create an int IP address for sorting purposes
|
||||
ip_int = sum([int(byte) << shift
|
||||
for byte, shift in izip(peer["ip"].split(":")[0].split("."), (24, 16, 8, 0))])
|
||||
|
||||
if peer["seed"]:
|
||||
icon = self.seed_pixbuf
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue