X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e25ac974810a9c235242d5a4f6bb0c779ddb430a..3cecb0072a5dd7e0d0e44333e17a7c87e6e5234f:/skin.py diff --git a/skin.py b/skin.py index ac66c8d4..26c08207 100644 --- a/skin.py +++ b/skin.py @@ -1,6 +1,10 @@ +from Tools.Profile import profile, profile_final + +profile("LOAD:minidom") import xml.dom.minidom from os import path +profile("LOAD:enigma_skin") from enigma import eSize, ePoint, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, \ addFont, gRGB, eWindowStyleSkinned @@ -52,6 +56,7 @@ def loadSkin(name): config.skin = ConfigSubsection() config.skin.primary_skin = ConfigText(default = "skin.xml") +profile("LoadSkin") try: loadSkin(config.skin.primary_skin.value) except (SkinError, IOError, AssertionError), err: @@ -60,7 +65,9 @@ except (SkinError, IOError, AssertionError), err: config.skin.primary_skin.value = 'skin.xml' loadSkin('skin.xml') +profile("LoadSkinDefault") loadSkin('skin_default.xml') +profile("LoadSkinDefaultDone") def parsePosition(str): x, y = str.split(',') @@ -99,7 +106,13 @@ def collectAttributes(skinAttributes, node, skin_path_prefix=None, ignore=[]): skinAttributes.append((attrib, value)) def loadPixmap(path, desktop): - ptr = LoadPixmap(path, desktop) + cached = False + option = path.find("#") + if option != -1: + options = path[option+1:].split(',') + path = path[:option] + cached = "cached" in options + ptr = LoadPixmap(path, desktop, cached) if ptr is None: raise SkinError("pixmap file %s not found!" % (path)) return ptr