[PyQt] kdecore.KProcess.Communication enum not OR-able

Jim Bublitz jbublitz at nwinternet.com
Sat Apr 12 17:37:34 BST 2008


On Saturday 12 April 2008 06:04, Wilbert Berendsen wrote:
> Hi,
>
> The KDE docs say that you can OR the values of the
> kdecore.KProcess.Communication enum when start()ing a KProcess.[1]
>
> However that seems not to be possible:
> >>> from kdecore import *
> >>> p=KProcess()
> >>> p.setExecutable('cat')
>
> True
>
> >>> p.start(KProcess.NotifyOnExit, KProcess.Stdin | KProcess.Stdout)
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: argument 2 of KProcess.start() has an invalid type
>
> >>> type(KProcess.Stdin | KProcess.Stdout)
>
> <type 'int'>
>
> >>> type(KProcess.Stdin)
>
> <class 'kdecore.Communication'>
>
>
> So I can only use the predefined values of the Communication enum (All,
> AllOuput etc.). Is this a bug and is there a workaround to start a
> KProcess() and only communicate with stdout and stdin and not stderr?

It appears that sip is doing strict checking for the KProcess.Communication 
type, and KProcess.Stdin | KProcess.Stdout is not defined in that enum type.

Jim

> [1]http://api.kde.org/3.5-api/kdelibs-apidocs/kdecore/html/classKProcess.ht
>ml#31e69eb366082bb93bbdc31e6e281019
>
> TIA,
> w best regards,
> Wilbert Berendsen


More information about the PyQt mailing list