[pygtk] gobject.io_add_watch buffered?

A.T.Hofkamp a.t.hofkamp at tue.nl
Wed May 6 21:02:14 WST 2009


Gabriele Lanaro wrote:

>     def writeout(self,file,event):
>         text=1
>         while text:
>                 text=file.readline()
>                 iter = self.buffer.get_end_iter()
>                 self.buffer.insert(iter,text)

I have not analysed your program, so I may be wrong, but here you seem to loop 
to read all output of file (a bad name for a handle btw).

Instead of reading everything, read only what is available, and return.
The io_watch should signal you the next time there is data.

Albert


More information about the pygtk mailing list