delete generated file libopen.so.0.0 on 'make clean'
[enigma2.git] / skin.py
diff --git a/skin.py b/skin.py
index ac66c8d467423c399965e1c0e010a41970d89543..26c08207df24ed04d2ac96d4086e3e4af4984ca1 100644 (file)
--- 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