Re: [partially solved] Re: [PyQt] KProcess setUsePty not there...

2008-04-13 Thread Giovanni Bajo
On Sat, 2008-04-12 at 19:53 +0200, Wilbert Berendsen wrote:

 A remaining question, as I can't ask the users of my LilyKDE module to 
 recompile PyKDE: does setUsePty work in mainstream distributions like Ubuntu?

I don't know the answer, but the workaround is a tiny C++ module
(wrapped with SIP) which exposes a single function which calls setUsePty
on the object you pass it, and then monkey-patch KProcess:

---
void MySetUsePty(KProcess *proc, KProcess::Communication c, bool b)
{
   proc-setUsePty(c, b);
}
---
[...]
import useptyfix
KProcess.setUsePty = useptyfix.MySetUsePty
---

-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[partially solved] Re: [PyQt] KProcess setUsePty not there...

2008-04-12 Thread Wilbert Berendsen
Op donderdag 3 april 2008, schreef Jim Bublitz:
 On Wednesday 02 April 2008 08:00, Wilbert Berendsen wrote:
  Hi,
 
  I want to run a program that insists on reading from a terminal using
  KProcess (from within PyKDE), but it seems KProcess::setUsePty() does not
  exist:
 
  Python 2.5.1 (r251:54863, Mar 26 2008, 22:37:08)
  [GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2
  Type help, copyright, credits or license for more information.
 
   from kdecore import *
   p=KProcess()
   p.setUsePty(3,False)

 It's an error in not providing a #define for a conditional in the h file
 when generating PyKDE.

Is this a bug in KDE, in PyKDE or in Gentoo's compile setup?

 You can fix it in sip/kdecore/kprocess.sip by changing this (near line
 193):

 %If ( KDE_3_2_0 - KDE_3_4_0 )
 void setUsePty (KProcess::Communication, bool);
 KPty*pty () const;
 %End

 to this:

 %If ( KDE_3_2_0 -   )
 void setUsePty (KProcess::Communication, bool);
 KPty*pty () const;
 %End

 and then rebuild with

 python configure.py -lkdecore  make  su -cmake install

I did that and yes, now setUsePty works. Thanks!

A remaining question, as I can't ask the users of my LilyKDE module to 
recompile PyKDE: does setUsePty work in mainstream distributions like Ubuntu?

Thanks,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
You must be the change you wish to see in the world.
-- Mahatma Gandhi
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] KProcess setUsePty not there...

2008-04-03 Thread Wilbert Berendsen
Hi,

I want to run a program that insists on reading from a terminal using KProcess 
(from within PyKDE), but it seems KProcess::setUsePty() does not exist:

Python 2.5.1 (r251:54863, Mar 26 2008, 22:37:08)
[GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2
Type help, copyright, credits or license for more information.
 from kdecore import *
 p=KProcess()
 p.setUsePty(3,False)
Traceback (most recent call last):
  File stdin, line 1, in module
AttributeError: setUsePty

KDE: 3.5.8
dev-python/sip: 4.7.3
dev-python/pykde: 3.16.0
dev-python/PyQt: 3.17.4

How can I fix this?

with best regards,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
Met vriendelijke groet,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
You must be the change you wish to see in the world.
-- Mahatma Gandhi
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] KProcess setUsePty not there...

2008-04-03 Thread Jim Bublitz
On Wednesday 02 April 2008 08:00, Wilbert Berendsen wrote:
 Hi,

 I want to run a program that insists on reading from a terminal using
 KProcess (from within PyKDE), but it seems KProcess::setUsePty() does not
 exist:

 Python 2.5.1 (r251:54863, Mar 26 2008, 22:37:08)
 [GCC 4.1.2 (Gentoo 4.1.2 p1.0.2)] on linux2
 Type help, copyright, credits or license for more information.

  from kdecore import *
  p=KProcess()
  p.setUsePty(3,False)

It's an error in not providing a #define for a conditional in the h file when 
generating PyKDE.

You can fix it in sip/kdecore/kprocess.sip by changing this (near line 193):

%If ( KDE_3_2_0 - KDE_3_4_0 )
void setUsePty (KProcess::Communication, bool);
KPty*pty () const;
%End

to this:

%If ( KDE_3_2_0 -   )
void setUsePty (KProcess::Communication, bool);
KPty*pty () const;
%End

and then rebuild with

python configure.py -lkdecore  make  su -cmake install

Jim
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt