if os.path.exists(opj(_ad, module)) or os.path.exists(opj(_ad, '%s.zip' % module)):
return opj(_ad, module)
+ logger.notifyChannel('init', netsvc.LOG_WARNING, 'addon:%s:module not found' % (module,))
+ return False
raise IOError, 'Module not found : %s' % module
def get_module_resource(module, *args):
@return: absolute path to the resource
"""
- return opj(get_module_path(module), *args)
+ a = get_module_path(module)
+ return a and opj(a, *args) or False
def get_modules():
"""Returns the list of module names
except IOError:
continue
terp_file = get_module_resource(module, '__terp__.py')
+ if not terp_file: continue
if os.path.isfile(terp_file) or zipfile.is_zipfile(mod_path):
try:
info = eval(tools.file_open(terp_file).read())
for i in addons.get_modules():
terp_file = addons.get_module_resource(i, '__terp__.py')
mod_path = addons.get_module_path(i)
+ if not mod_path:
+ continue
info = False
if os.path.isfile(terp_file) and not os.path.isfile(mod_path+'.zip'):
info = eval(file(terp_file).read())