use Tools.Directories to get paths
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 11 Jan 2006 16:01:01 +0000 (16:01 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 11 Jan 2006 16:01:01 +0000 (16:01 +0000)
lib/python/Screens/Menu.py
skin.py

index a12571e7c0ed58ebe835ffdb137e8070f7133fbe..68a8ef98bfca4c31ac86551499efaa8c6d951914 100644 (file)
@@ -6,6 +6,8 @@ from Components.Button import Button
 from Components.Label import Label
 from Components.ProgressBar import ProgressBar
 
 from Components.Label import Label
 from Components.ProgressBar import ProgressBar
 
+from Tools.Directories import resolveFilename, SCOPE_SKIN
+
 from enigma import quitMainloop
 
 import xml.dom.minidom
 from enigma import quitMainloop
 
 import xml.dom.minidom
@@ -29,12 +31,7 @@ def doGlobal(screen):
 
 
 # read the menu
 
 
 # read the menu
-try:
-       # first we search in the current path
-       menufile = file('data/menu.xml', 'r')
-except IOError:
-       # if not found in the current path, we use the global datadir-path
-       menufile = file('/usr/share/enigma2/menu.xml', 'r')
+menufile = file(resolveFilename(SCOPE_SKIN, 'menu.xml'), 'r')
 mdom = xml.dom.minidom.parseString(menufile.read())
 menufile.close()
 
 mdom = xml.dom.minidom.parseString(menufile.read())
 menufile.close()
 
diff --git a/skin.py b/skin.py
index c6d0678a142691d0419e9d3467389964458aa161..58426c0f18f052332f78b1da24a7318bcde92ba6 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -14,13 +14,10 @@ def dump(x, i=0):
        except:
                None
 
        except:
                None
 
+from Tools.Directories import resolveFilename, SCOPE_SKIN
+
 # read the skin
 # read the skin
-try:
-       # first we search in the current path
-       skinfile = file('data/skin.xml', 'r')
-except:
-       # if not found in the current path, we use the global datadir-path
-       skinfile = file('/usr/share/enigma2/skin.xml', 'r')
+skinfile = file(resolveFilename(SCOPE_SKIN, 'skin.xml'), 'r')
 dom = xml.dom.minidom.parseString(skinfile.read())
 skinfile.close()
 
 dom = xml.dom.minidom.parseString(skinfile.read())
 skinfile.close()