[PyKDE] dcop call always returns same value - UPDATE

Jim Bublitz jbublitz at nwinternet.com
Tue Jun 28 21:31:13 BST 2005


On Monday 27 June 2005 06:07, Sebastian Kügler wrote:
> Hi,
>
> While trying to interface the Kdesktop ScreensaverIface, I noticed an
> odd behaviour. If called via bash or kdcop,
>
> $ dcop kdesktop KScreensaverIface isEnabled
>
> would return the correct value, i.e. true or false whether I have
> checked "[ ] Start automatically" in kcmshell screensaver.
>
> Interfacing it via python, it _always_ returns "True", which to me seems
> a bug, but I may be doing something completely wrong ...
>
> Sample Script:
>
> # ---------------------------------------------------------------------

> # Following _always_ returns True :(
> is_enabled = kdesktop.KScreensaverIface.isEnabled()[0]

> Any ideas what's going wrong here?

The call returns a tuple, and the [0] element just indicates if the call 
succeeded or not - since it's succeeding, it returns True every time. The [1] 
element should be the result data, however that's returning 'None' at the 
moment, so the call still isn't working correctly.

I'm looking at it and will let you know.

UPDATE: handling for the 'bool' type wasn't implemented in PyKDE. I have a 
snapshot just about ready to go and will add the type before posting it. 
Should be available in a day or two.

Jim




More information about the PyQt mailing list