[PyKDE] dcop call always returns same value

Sebastian Kügler sebas at kde.nl
Mon Jun 27 14:07:02 BST 2005


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:

# ---------------------------------------------------------------------
import sys
import dcopext
from kdecore import *

aboutdata = KAboutData("dcop_test","dcop_test","0.0", "A test",
  KAboutData.License_GPL, "Copyleft")
KCmdLineArgs.init(sys.argv,aboutdata)
app = KApplication()

dcop = app.dcopClient()

kdesktop = dcopext.DCOPApp("kdesktop", dcop)

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

print "Screensaver is", {True:"Enabled",False:"Disabled"}[is_enabled]
# ---------------------------------------------------------------------

Tested with Python 2.3 / PyKDE 3.11.3 (Debian) and Python 2.4, 
PyKDE20050316.

Any ideas what's going wrong here?

Cheers,

sebas
-- 
  http://vizZzion.org   |   GPG Key ID: 9119 0EF9 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Anything cut to length will be too short.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20050627/74e13185/attachment.bin


More information about the PyQt mailing list