--------- Original Message --------
        Da: Gustavo J. A. M. Carneiro <[EMAIL PROTECTED]>
        To: Dario M�ndez <[EMAIL PROTECTED]>
                Cc: [EMAIL PROTECTED]
        Oggetto: Re: [pygtk] Pipes and freezes
        Data: 28/04/04 01:14
        
        > 
> A Ter, 2004-04-27 �s 07:58, Dario M�ndez escreveu:
> &gt; Greetings everyone, I've just began PyGTK developing today and I
started 
> &gt; to get my GTKmm kernel compilation utility &quot;ported&quot; to
PyGTK.
> &gt; 
> &gt; In order to display the make ouput I used a particular Glib method 
> &gt; (spawn_async_with_pipes).
> &gt; 
> &gt; I've tryed looking around, but I didn't find any equivalent, so I
hooked 
> &gt; up the old popen(), wich, of course, freezes the window during the
make 
> &gt; process.
> &gt; 
> &gt; Does anybody know a way to display the popen output while the process
is 
> &gt; running?
> 
>   Just like in C, in Python use gobject.input_add to know when to read
> from child stdout.  Seems very simple.  Or do you have a more specific
> problem?
> 
> &gt; Thanks in advance
> &gt; _______________________________________________
> &gt; pygtk mailing list   [EMAIL PROTECTED]
> &gt; http://www.daa.com.au/mailman/listinfo/pygtk
> &gt; Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
> -- 
> Gustavo J. A. M. Carneiro
> &lt;[EMAIL PROTECTED]&gt; &lt;[EMAIL PROTECTED]&gt;
> 
> 
Uhm... I'm actually using this to read the make ouput

        def compile_kernel(self, widget):
                textbuffer = gtk.TextBuffer()
                fin = os.popen("uname -r") 
                ker_ver = fin.readline() 
                fin.close() 
                self.compile_status.set_buffer(textbuffer) 
                fin = os.popen("cd /usr/src/linux && make && make modules_install && cp
arch/i386/boot/bzImage /boot/bzImage-" + ker_ver) 
                line = None
                while line != '':
                        line = fin.readline()
                        textbuffer.insert_at_cursor(line)
                fin.close()
                return

I've never knew anything about gobjects, have you got some kind of reference
(possibly an example)?
Thanks 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=&d=20040428


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to