X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=skin.py;h=9d4b757168273b00f86dd51fec793661ab09c370;hb=8b0a581bf9ec96b6b698fa2d236d2aadc417f9da;hp=af1c97ca6d0d533e6cf0fb948b474bad254d28d3;hpb=0553c86de8408e265af9599cbc7c0e079b82364d;p=vuplus_dvbapp diff --git a/skin.py b/skin.py index af1c97c..9d4b757 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(',')