Bou Baris wrote:
>> I think this is due to mkvextract not flushing its output because it's not
>> connected to a tty. Try using a pty in between to fool mkvextract. Something
>> like:
>>
>> from_mkve, to me = pty.openpty()
>> to_me = os.fdopen(to_me, 'r')
>> file_flags = fcntl.fcntl(to_me, fcntl.F_GETFL)
>> fcntl.fcntl(to_me, fcntl.F_SETFL, file_flags|os.O_NDELAY)
>> proc = subprocess.Popen(command, stdout=from_mkve)
>> gobject.io_add_watch(to_me, gobject.IO_IN|gobject.IO_HUP,
>> self.test_io_watch)
>>
>>     
> Thanks for your suggestion. This evening when I come back @home I'll try it.
>
> BTW if 'mkvextract' doesn't flush its output, I should have the same
> problem running my original code that use 'select'.
> Using 'select' is fine, there is no block to the flow due to lack of
> stdout flush, BUT the problem is GUI that is stopped.
>
> One hour ago I've also tried with thread (using module thread and
> thread.start_new_thread() function).
> The same behaviour...... GUI is stopped until subprocess.Popen() end.
>
>   
I'm guessing that you are printing a buffer full of output at a time but 
the progressbar isn't getting updated because the program is stuck in 
the select() loop and can't run the gtk event processing loop until it 
exits the loop i.e. when the mkvextract program ends.

John
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to