-from Tools.Profile import profile, profile_final
+from Tools.Profile import profile
profile("LOAD:ElementTree")
import xml.etree.cElementTree
from os import path
from Tools.Import import my_import
from Tools.LoadPixmap import LoadPixmap
-from Tools.XMLTools import elementsWithTag, mergeText
-
colorNames = dict()
def dump(x, i=0):
self.message = message
def __str__(self):
- return self.message
+ return "{%s}: %s" % (config.skin.primary_skin, self.message)
dom_skins = [ ]
}[value])
elif attrib == "orientation": # used by eSlider
try:
- guiObject.setOrientation(
- { "orVertical": guiObject.orVertical,
- "orHorizontal": guiObject.orHorizontal
+ 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!"
id = 0
if id == 0: # framebuffer
for res in c.findall("resolution"):
- get_attr = c.attrib.get
+ get_attr = res.attrib.get
xres = get_attr("xres")
if xres:
xres = int(xres)
#print "Resolution:", xres,yres,bpp
from enigma import gFBDC
gFBDC.getInstance().setResolution(xres, yres)
+ desktop.resize(eSize(xres, yres))
if bpp != 32:
# load palette (not yet implemented)
pass
colorNames[name] = parseColor(color)
#print "Color:", name, color
else:
- raise ("need color and name, got %s %s" % (name, color))
+ raise SkinError("need color and name, got %s %s" % (name, color))
for c in skin.findall("fonts"):
for font in c.findall("font"):
try:
style.setColor(eWindowStyleSkinned.__dict__["col" + type], color)
except:
- raise ("Unknown color %s" % (type))
+ raise SkinError("Unknown color %s" % (type))
#pass
#print " color:", type, color
ctype = converter.get('type')
assert ctype, "'convert'-tag needs a 'type'-attribute"
#print "Converter:", ctype
- #parms = mergeText(converter.childNodes).strip()
try:
parms = converter.text.strip()
except:
parms = ""
- #print "Params:", ctype
- converter_class = my_import('.'.join(["Components", "Converter", ctype])).__dict__.get(ctype)
+ #print "Params:", parms
+ converter_class = my_import('.'.join(("Components", "Converter", ctype))).__dict__.get(ctype)
c = None
source = c
- renderer_class = my_import('.'.join(["Components", "Renderer", wrender])).__dict__.get(wrender)
+ renderer_class = my_import('.'.join(("Components", "Renderer", wrender))).__dict__.get(wrender)
renderer = renderer_class() # instantiate renderer