fix: retrieve third icons even if module is local

This commit is contained in:
Romain Bignon 2012-02-11 16:19:22 +01:00
commit d6534ae845

View file

@ -67,7 +67,7 @@ class ModuleInfo(object):
self.description = to_unicode(items['description']) self.description = to_unicode(items['description'])
self.maintainer = to_unicode(items['maintainer']) self.maintainer = to_unicode(items['maintainer'])
self.license = to_unicode(items['license']) self.license = to_unicode(items['license'])
self.icon = items['icon'] self.icon = items['icon'].strip() or None
self.urls = items['urls'] self.urls = items['urls']
def has_caps(self, caps): def has_caps(self, caps):
@ -482,16 +482,15 @@ class Repositories(object):
dest_path = self.get_module_icon_path(module) dest_path = self.get_module_icon_path(module)
if module.is_local(): icon_url = module.icon
icon_path = os.path.join(module.path, module.name, 'favicon.png') if not icon_url:
if module.path and os.path.exists(icon_path): if module.is_local():
shutil.copy(icon_path, dest_path) icon_path = os.path.join(module.path, module.name, 'favicon.png')
return if module.path and os.path.exists(icon_path):
shutil.copy(icon_path, dest_path)
if module.icon: return
icon_url = module.icon else:
else: icon_url = module.url.replace('.tar.gz', '.png')
icon_url = module.url.replace('.tar.gz', '.png')
browser = WeboobBrowser() browser = WeboobBrowser()
try: try: