aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Tools
diff options
context:
space:
mode:
authoracid-burn <acid-burn@opendreambox.org>2009-12-23 06:47:59 +0100
committeracid-burn <acid-burn@opendreambox.org>2009-12-23 06:47:59 +0100
commit9c998a40679f9b630ccf8cc6fda7384ce94c30e5 (patch)
tree6e31e148f6153232293b339ddf2e0c6328bf1e22 /lib/python/Tools
parentd6ad23c5be62bc24cc08a5c8db91f64ae2d8cf3b (diff)
parentd64e82b37efdf77b557234809d0c81857818bfac (diff)
downloadenigma2-9c998a40679f9b630ccf8cc6fda7384ce94c30e5.tar.gz
enigma2-9c998a40679f9b630ccf8cc6fda7384ce94c30e5.zip
Merge branch 'bug_249_current_skin_fallback'
Conflicts: lib/python/Components/FileList.py
Diffstat (limited to 'lib/python/Tools')
-rwxr-xr-xlib/python/Tools/Directories.py23
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: