[IMP] icon management in modules
* If icon is present in descriptor file, use that path * Else try to find #{module}/static/src/img/icon.png * Else fallback on /base/static/src/img/icon.png bzr revid: xmo@openerp.com-20111209122803-elwonegpl8kut7pf
This commit is contained in:
parent
c25475879c
commit
9e94b86bfe
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
@ -218,6 +218,11 @@ def get_module_resource(module, *args):
|
||||||
return resource_path
|
return resource_path
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def get_module_icon(module):
|
||||||
|
iconpath = ['static', 'src', 'img', 'icon.png']
|
||||||
|
if get_module_resource(module, *iconpath):
|
||||||
|
return ('/' + module + '/') + '/'.join(iconpath)
|
||||||
|
return '/base/' + '/'.join(iconpath)
|
||||||
|
|
||||||
def load_information_from_description_file(module):
|
def load_information_from_description_file(module):
|
||||||
"""
|
"""
|
||||||
|
@ -241,7 +246,7 @@ def load_information_from_description_file(module):
|
||||||
'complexity': 'normal',
|
'complexity': 'normal',
|
||||||
'depends': [],
|
'depends': [],
|
||||||
'description': '',
|
'description': '',
|
||||||
'icon': None,
|
'icon': get_module_icon(module),
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'name': False,
|
'name': False,
|
||||||
|
|
Loading…
Reference in New Issue