sanity checks for the timer
[enigma2.git] / skin.py
diff --git a/skin.py b/skin.py
index bf8de72a34de82c6a71d4b1801e87ddc9edfc362..5744855ce35d431077448c4378f77248892b465e 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -16,11 +16,14 @@ def dump(x, i=0):
 
 # read the skin
 try:
 
 # read the skin
 try:
-       skinfile = file('/usr/share/enigma2/skin.xml', 'r')
-       dom = xml.dom.minidom.parseString(skinfile.read())
-       skinfile.close()
+       # first we search in the current path
+       skinfile = file('data/skin.xml', 'r')
 except:
 except:
-       print "Error opening skin.xml"
+       # if not found in the current path, we use the global datadir-path
+       skinfile = file('/usr/share/enigma2/skin.xml', 'r')
+dom = xml.dom.minidom.parseString(skinfile.read())
+skinfile.close()
+
 
 def parsePosition(str):
        x, y = str.split(',')
 
 def parsePosition(str):
        x, y = str.split(',')
@@ -77,6 +80,14 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                        desktop.makeCompatiblePixmap(ptr)
                        guiObject.setPixmap(ptr)
                        # guiObject.setPixmapFromFile(value)
                        desktop.makeCompatiblePixmap(ptr)
                        guiObject.setPixmap(ptr)
                        # guiObject.setPixmapFromFile(value)
+               elif attrib == "orientation": # used by eSlider
+                       try:
+                               guiObject.setOrientation(
+                                       { "orVertical": guiObject.orVertical,
+                                               "orHorizontal": guiObject.orHorizontal
+                                       }[value])
+                       except KeyError:
+                               print "oprientation must be either orVertical or orHorizontal!"
                elif attrib == "valign":
                        try:
                                guiObject.setVAlign(
                elif attrib == "valign":
                        try:
                                guiObject.setVAlign(
@@ -233,5 +244,4 @@ def readSkin(screen, skin, name, desktop):
                
                # applyAttributes(guiObject, widget, desktop)
                # guiObject.thisown = 0
                
                # applyAttributes(guiObject, widget, desktop)
                # guiObject.thisown = 0
-               print screen.additionalWidgets
                screen.additionalWidgets.append(w)
                screen.additionalWidgets.append(w)