[FIX] fixed regression on get_module_resource method to clean checking of file
bzr revid: hmo@tinyerp.com-20101011065703-96zngxucees6zwx1
This commit is contained in:
@@ -270,16 +270,17 @@ def get_module_resource(module, *args):
|
||||
@return: absolute path to the resource
|
||||
"""
|
||||
a = get_module_path(module)
|
||||
res = a and opj(a, *args) or False
|
||||
if zipfile.is_zipfile( a +'.zip') :
|
||||
zip = zipfile.ZipFile( a + ".zip")
|
||||
files = ['/'.join(f.split('/')[1:]) for f in zip.namelist()]
|
||||
files = [opj(a,'/'.join(f.split('/')[1:])) for f in zip.namelist()]
|
||||
if res in files:
|
||||
return res
|
||||
else:
|
||||
files = tools.osutil.listdir(a, True)
|
||||
for ar in args:
|
||||
if ar not in files:
|
||||
return False
|
||||
res = a and opj(a, *args) or False
|
||||
return res
|
||||
if os.path.isfile(res):
|
||||
return res
|
||||
|
||||
return False
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user