if icons[icon]:
bookmark.icon_href = icon
content_type, bookmark.icon = icons[icon]
- self.log(" cached icon: %s" % content_type)
+ self.log(" cached icon: %s" % content_type)
else:
- self.log(" cached icon: no icon")
+ self.log(" cached icon: no icon")
else:
try:
_icon = icon
icon_fname, headers = urllib.urlretrieve(_icon)
except RedirectException, e:
_icon = e.url
- self.log(" redirect to : %s" % _icon)
+ self.log(" redirect to : %s" % _icon)
else:
break
else:
self.log(" got icon : %s" % content_type)
if content_type.startswith("application/") \
or content_type.startswith("text/plain"):
- self.log(" non-image content type, assume x-icon")
+ self.log(" non-image content type, assume x-icon")
content_type = 'image/x-icon'
bookmark.icon = "data:%s;base64,%s" % (content_type, b64encode(icon_data))
icons[icon] = (content_type, bookmark.icon)