X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/0553c86de8408e265af9599cbc7c0e079b82364d..35604d1b74e329aed018b90c222f4717a0726236:/skin.py diff --git a/skin.py b/skin.py index af1c97ca..9d4b7571 100644 --- a/skin.py +++ b/skin.py @@ -14,143 +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(',')