X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/2e02d72e10207215592e4aeda8b1c5cf18f7115a..1d0a109bc97ea1d32928de03b90c4d043ddf2b25:/skin.py diff --git a/skin.py b/skin.py index 0c5f3368..eae6ea4b 100644 --- a/skin.py +++ b/skin.py @@ -144,23 +144,17 @@ def applySingleAttribute(guiObject, desktop, attrib, value, scale = ((1,1),(1,1) "blend": 2, }[value]) elif attrib == "orientation": # used by eSlider - if value in ("orHorizontal", "orLeftToRight"): - orientation = guiObject.orHorizontal - direction = guiObject.dirNormal - elif value in ("orVertical", "orTopToBottom"): - orientation = guiObject.orVertical - direction = guiObject.dirNormal - elif value == "orRightToLeft": - orientation = guiObject.orHorizontal - direction = guiObject.dirSwapped - elif value == "orBottomToTop": - orientation = guiObject.orVertical - direction = guiObject.dirSwapped - else: - print "orientation must be one of: orTopToBottom,orBottomToTop,orLeftToRight,orRightToLeft" - return - guiObject.setOrientation(orientation) - guiObject.setDirection(direction) + try: + guiObject.setOrientation(* + { "orVertical": (guiObject.orVertical, False), + "orTopToBottom": (guiObject.orVertical, False), + "orBottomToTop": (guiObject.orVertical, True), + "orHorizontal": (guiObject.orHorizontal, False), + "orLeftToRight": (guiObject.orHorizontal, False), + "orRightToLeft": (guiObject.orHorizontal, True), + }[value]) + except KeyError: + print "oprientation must be either orVertical or orHorizontal!" elif attrib == "valign": try: guiObject.setVAlign(