mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-14 13:34:21 +00:00
Fix alignment of tracker icons when tracker does not have an icon
This commit is contained in:
parent
757f55f38e
commit
695e6a8c6e
@ -99,7 +99,13 @@ class TrackerIcons(object):
|
|||||||
return ("png", png)
|
return ("png", png)
|
||||||
|
|
||||||
# FIXME: This should be cleaned up and not copy the top code
|
# FIXME: This should be cleaned up and not copy the top code
|
||||||
|
|
||||||
|
try:
|
||||||
html = urlopen("http://%s/" % (host_name,))
|
html = urlopen("http://%s/" % (host_name,))
|
||||||
|
except Exception, e:
|
||||||
|
log.debug(e)
|
||||||
|
html = None
|
||||||
|
|
||||||
if html:
|
if html:
|
||||||
icon_path = ""
|
icon_path = ""
|
||||||
line = html.readline()
|
line = html.readline()
|
||||||
@ -138,11 +144,13 @@ class TrackerIcons(object):
|
|||||||
|
|
||||||
if icon_data:
|
if icon_data:
|
||||||
filename = os.path.join(get_default_config_dir("icons"),"%s.%s" % (tracker_host, ext))
|
filename = os.path.join(get_default_config_dir("icons"),"%s.%s" % (tracker_host, ext))
|
||||||
print filename
|
|
||||||
f = open(filename,"wb")
|
f = open(filename,"wb")
|
||||||
f.write(icon_data)
|
f.write(icon_data)
|
||||||
f.close()
|
f.close()
|
||||||
self.images[tracker_host] = filename
|
self.images[tracker_host] = filename
|
||||||
|
else:
|
||||||
|
filename = None
|
||||||
|
|
||||||
if callback:
|
if callback:
|
||||||
gobject.idle_add(callback, filename)
|
gobject.idle_add(callback, filename)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user