return `abspath` in `resource_find`. Seems to be needed when android uses apkexpansion

This commit is contained in:
akshayaurora 2016-07-25 20:48:52 +05:30
parent 8e698996f8
commit a84ee718c1
1 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ images and icons.
__all__ = ('resource_find', 'resource_add_path', 'resource_remove_path')
from os.path import join, dirname, exists
from os.path import join, dirname, exists, abspath
from kivy import kivy_data_dir
from kivy.utils import platform
from kivy.logger import Logger
@ -52,11 +52,11 @@ def resource_find(filename):
if filename[:8] == 'atlas://':
return filename
if exists(filename):
return filename
return abspath(filename)
for path in reversed(resource_paths):
output = join(path, filename)
if exists(output):
return output
return abspath(output)
if filename[:5] == 'data:':
return filename
return None