[FIX] oe: better filter of potential modules in addons paths.

bzr revid: vmt@openerp.com-20130507084941-afovplgo507holzl
This commit is contained in:
Vo Minh Thu 2013-05-07 10:49:41 +02:00
parent 7743760a4f
commit e6a0631977
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,8 @@ def get_addons_from_paths(paths, exclude):
if os.path.exists(p):
names = list(set(os.listdir(p)))
names = filter(lambda a: not (a.startswith('.') or a in exclude), names)
names = filter(lambda a: os.path.isdir(os.path.join(p, a)), names)
names = filter(lambda a: os.path.exists(os.path.join(p, a, '__openerp__.py')), names)
module_names.extend(names)
else:
print "The addons path `%s` doesn't exist." % p