bugfix_empty_dir

bzr revid: fp@tinyerp.com-20081027121852-hcmyfyqbcdlk8cuz
This commit is contained in:
Fabien Pinckaers 2008-10-27 13:18:52 +01:00
parent 96e69a0a25
commit 537bb6835a
2 changed files with 7 additions and 1 deletions

View File

@ -142,6 +142,8 @@ def get_module_path(module):
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):
@ -152,7 +154,8 @@ 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
@ -178,6 +181,7 @@ def create_graph(module_list, force=None):
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())

View File

@ -62,6 +62,8 @@ def init_db(cr):
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())