diff options
| author | acid-burn <acidburn@opendreambox.org> | 2009-11-11 10:56:30 +0100 |
|---|---|---|
| committer | acid-burn <acidburn@opendreambox.org> | 2009-11-11 10:56:30 +0100 |
| commit | 39f3d5a554528bcbdc79cc0f2bdd2d59c92b0a4e (patch) | |
| tree | 26eb3798f34956754bef6c9f4a2c1a285601876a /lib/python/Tools/Directories.py | |
| parent | 383faf2da1a60442431dce44760a0392c5829dc8 (diff) | |
| parent | d64e82b37efdf77b557234809d0c81857818bfac (diff) | |
| download | enigma2-39f3d5a554528bcbdc79cc0f2bdd2d59c92b0a4e.tar.gz enigma2-39f3d5a554528bcbdc79cc0f2bdd2d59c92b0a4e.zip | |
Merge branch 'bug_249_current_skin_fallback' into experimental
Conflicts:
lib/python/Components/FileList.py
lib/python/Plugins/Extensions/MediaPlayer/plugin.py
Diffstat (limited to 'lib/python/Tools/Directories.py')
| -rwxr-xr-x | lib/python/Tools/Directories.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/python/Tools/Directories.py b/lib/python/Tools/Directories.py index 681bc049..8ed2c8a4 100755 --- a/lib/python/Tools/Directories.py +++ b/lib/python/Tools/Directories.py @@ -33,6 +33,7 @@ SCOPE_DEFAULTDIR = 13 SCOPE_DEFAULTPARTITION = 14 SCOPE_DEFAULTPARTITIONMOUNTDIR = 15 SCOPE_METADIR = 16 +SCOPE_CURRENT_PLUGIN = 17 PATH_CREATE = 0 PATH_DONTCREATE = 1 @@ -85,7 +86,27 @@ def resolveFilename(scope, base = "", path_prefix = None): tmp = defaultPaths[SCOPE_SKIN] pos = config.skin.primary_skin.value.rfind('/') if pos != -1: - path = tmp[0]+config.skin.primary_skin.value[:pos+1] + #if basefile is not available use default skin path as fallback + tmpfile = tmp[0]+config.skin.primary_skin.value[:pos+1] + base + if fileExists(tmpfile): + path = tmp[0]+config.skin.primary_skin.value[:pos+1] + else: + path = tmp[0] + else: + path = tmp[0] + + elif scope == SCOPE_CURRENT_PLUGIN: + tmp = defaultPaths[SCOPE_PLUGINS] + from Components.config import config + skintmp = defaultPaths[SCOPE_SKIN] + pos = config.skin.primary_skin.value.rfind('/') + if pos != -1: + #if basefile is not available inside current skin path, use the original provided file as fallback + skintmpfile = skintmp[0]+config.skin.primary_skin.value[:pos+1] + base + if fileExists(skintmpfile): + path = skintmp[0]+config.skin.primary_skin.value[:pos+1] + else: + path = tmp[0] else: path = tmp[0] else: |
