[PyKDE] Re: dcop problem querying wallpaper
Arash Abedinzadeh
arash at netcologne.de
Fri May 6 06:59:08 BST 2005
Sebastian Kügler wrote:
> Hi,
>
> Trying to query the name of the currently shown wallpaper I stumbled
> across the following, which is puzzling for me:
>
> #-------------- SNIP ------------------------------------------------
> import dcop, dcopext, sys
> from kdecore import *
>
> KCmdLineArgs.init (sys.argv,"bla","foo","bar")
> app = KApplication ()
> dcop = app.dcopClient ()
>
> kwin = dcopext.DCOPApp ("kwin", dcop)
> kdesktop = dcopext.DCOPApp ("kwin", dcop)
>
> # Huge list of methods, looks good
> print kwin.KWinInterface.getMethods()
>
> # Just works
> ok,current_desktop = kwin.KWinInterface.currentDesktop()
> print "Desktop is : ", current_desktop
>
> # None, also no Exception
> print kdesktop.KBackgroundIface.getMethods()
>
> # (False, None), no Exception
> print kdesktop.KBackgroundIface.currentWallpaper(current_desktop)
> #-------------- SNIP ------------------------------------------------
> [Python 2.3, KDE 3.4, PyKDE 3.11.3]
>
> While the kwin stuff works just fine, returning the name of the current
> desktop, from kdesktop.KBackgroundIface.getMethods() is empty and I
> don't even get the usual AttributeError yadda-yadda, also not my
> wallpaper name of course.
>
> Is that my lack of sleep tricking me?
>
> Thanks,
>
> sebas
Hi there,
- kdesktop = dcopext.DCOPApp ("kwin", dcop)
+ kdesktop = dcopext.DCOPApp ("kdesktop", dcop)
should do what you expect it to do.
I'm not very familiar with Python and its KDE bindings, but I suggest that
"KBackgroundIface" isn't a valid DCOP object name for the kwin application
and calling getMethods() on such a DCOPObj instance simply returns None. Do
we need an exception?
It would be great if someone could correct me. I'm sure it actually isn't
the way DCOP works here.
Regards,
--
Arash Abedinzadeh
More information about the PyQt
mailing list