From 537bb6835a53fe05062dd43685a3f711a6f3448d Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 27 Oct 2008 13:18:52 +0100 Subject: [PATCH] bugfix_empty_dir bzr revid: fp@tinyerp.com-20081027121852-hcmyfyqbcdlk8cuz --- bin/addons/__init__.py | 6 +++++- bin/tools/misc.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index 01441910488..1f9f3be0190 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -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()) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index 9e292c9e27a..65c9c8c5d35 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -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())