[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    [Panel-devel] getThemePath broken in SK
From:       p0z3r () earthlink ! net (Ryan Nickell)
Date:       2005-06-06 0:44:53
Message-ID: 1118011646.1999.2.camel () linux ! site
[Download RAW message or body]

On Mon, 2005-06-06 at 09:09 +1200, Matt wrote:
> On Mon, 06 Jun 2005 08:36, Petri Damsten wrote:
> > On Sunday 05 June 2005 22:35, Matt wrote:
> > > Could you also explain the new readThemeFile function, so I can
> > > understand if it will help me.
> >
> > This code should produce two similar outputs if it's run from non skz
> > themes. Latter should also work from skz theme.
> >
> >     # Reading file (doesn't work with skz themes)
> >     f = open(karamba.getThemePath(widget) + '/maindata.xml')
> >     s = f.read()
> >     f.close()
> >     print s
> >
> >     # This works also in skz themes
> >     s = karamba.readThemeFile(widget, 'maindata.xml')
> >     print s
> >
> > Petri
> 
> I'm not sure that that will help either of my issues.  The codecs.open() 
> function is what I use to be able to use utf-8 encoded translation files.  In 
> the second example, is the new object 's' an unadulterated version of 
> maindata.xml?  If so, I may still be able to manipulate it, to decode it.  
> I'll need to update from svn and test it later today.
You could use the ZipFile class in python to get the data read in as
well.  I'm not sure how this will affect the codecs.open() method that
you are currently using, but here's some example code:
>>> import zipfile
>>> file = zipfile.ZipFile("liquid_weather.skz")
>>> translations = file.read('translations/English')

> 
> In terms of changing to a new 'root' directory in the theme, if you're using 
> an skz file, are all files relative to the .skz file?
> 
Btw, I looked at the os.chdir() you have, and I'm not sure why you chdir
into the theme path to execute 'dcop kxdocker'?
I may be missing something as I only looked over it quickly.

-Ryan

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic