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

List:       pykde
Subject:    Re: [PyKDE] DCOP problem
From:       Jim Bublitz <jbublitz () nwinternet ! com>
Date:       2006-05-26 16:23:40
Message-ID: 200605260923.41142.jbublitz () nwinternet ! com
[Download RAW message or body]

On Thursday 25 May 2006 09:06, Micha³ Wo¼niak wrote:
> Hi there, guys
>
> Got a strange issue here: trying to have my Python script open a new
> KMail's Composer window through DCOP, but I can't seem to be able to call
> the appropriate function.
>
> Now, from shell, everything works great:
> dcop kontact KMailIface openComposer to cc bcc subject body False
> opens me a new window.
>
> What's more, 1. I can call other functions of the KMailIface object from
> Python without any issues, and 2. the script below actually lists the
> "openComposer" method (a few times), but apparently does not call it. As
> you will see in the code below, I tried three ways of passing the
> arguments, in case I am missing something here, but no luck either. Any
> ideas?

If I add KURL(""):

print dcApp.KMailIface.openComposer(QString('to'), QString('cc'), 
QString('bcc'), QString('subject'), QString('body'), False, 
KURL (""))

at the end, that works as far as creating a composer window with 'body' as the 
text (an actual URL argument to KURL seems to work correctly too). Of course 
you don't get a DCOPRef back - just an int.

The problem is that PyKDE/extensions/dcopext.py (which does the DCOP stuff) 
doesn't handle overloaded methods correctly (or at all, for that matter). 
There's an alternative version here:

http://twoday.tuwien.ac.at/pub/stories/22870/

I haven't had time to check it out completely, so PyKDE hasn't been modified, 
but it looks like it should work. To try it out, download it and replace the 
installed dcopext.py (usually in site-packages, or wherever the Qt and PyKDE 
modules are installed) with the newer version. The revised version, or 
something similar, will probably go in the next release.

If you test the modified version, I'd appreciate a post to the list about how 
it works.

Apologies for the slow reply - I've been replacing a fried mobo and upgrading 
to a 64 bit CPU.

Jim

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

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

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