X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/1f64831b3ba377e7fa896c67e3860ab997df0ea3..ebb18fe31efe7c97288f815950020b3f2dd6af98:/skin.py diff --git a/skin.py b/skin.py index 75773688..9d4b7571 100644 --- a/skin.py +++ b/skin.py @@ -14,134 +14,16 @@ def dump(x, i=0): except: None -dom = xml.dom.minidom.parseString( - """ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - """ """ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# this should be factored out into some helper code, but currently demonstrated applets. -from enigma import eSize, ePoint - -orgwidth = self.instance.size().width() -orgpos = self.instance.position() -textsize = self["text"].getSize() - -# y size still must be fixed in font stuff... -textsize = (textsize[0], textsize[1] + 20) -wsize = (textsize[0] + 20, textsize[1] + 20) - -# resize -self.instance.resize(eSize(*wsize)) - -# resize label -self["text"].instance.resize(eSize(*textsize)) +# read the skin +try: + # first we search in the current path + skinfile = file('data/skin.xml', 'r') +except: + # 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() -# center window -newwidth = wsize[0] -self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y())) - - - """) def parsePosition(str): x, y = str.split(',')