I have written a small wxPython application which is a media file
uploader to be used with a custom CSM/DAM we use here at UT Austin.
It uses httplib to "POST" a file to the CMS. The whole thing works
properly, except for the output. I am writing the output to a text
control, and nothing gets written until all of the files have uploaded
(perhaps output is buffered). I would like to have the output display
incrementally in real time. If I simply "print" the output, I see the
proper incremental output on the command line from which I launched
the app, but I cannot get that to work in a text control.
I have written a small wxPython application which is a media file
uploader to be used with a custom CSM/DAM we use here at UT Austin.
It uses httplib to "POST" a file to the CMS. The whole thing works
properly, except for the output. I am writing the output to a text
control, and nothing gets written until all of the files have uploaded
(perhaps output is buffered). I would like to have the output display
incrementally in real time. If I simply "print" the output, I see the
proper incremental output on the command line from which I launched
the app, but I cannot get that to work in a text control.
If it is of use, attached is the code.
thanks-
Peter Keane
You'll probably want to take a look at this wiki entry:
You are running the upload job in the same thread as the gui so it is blocking the gui from doing the updates to the screen.
Options:
You may be able to solve this by adding a call to wx.YieldIfNeeded() after each time you add text the text control this will make you function temporarly yield and allow the main thread to check and process any pending events.
or
Move the upload code to a separate thread and post the update messages back to the main thread for display.
I have written a small wxPython application which is a media file
uploader to be used with a custom CSM/DAM we use here at UT Austin.
It uses httplib to “POST” a file to the CMS. The whole thing works
properly, except for the output. I am writing the output to a text
control, and nothing gets written until all of the files have uploaded
(perhaps output is buffered). I would like to have the output display
incrementally in real time. If I simply “print” the output, I see the
proper incremental output on the command line from which I launched
the app, but I cannot get that to work in a text control.
On Fri, Sep 12, 2008 at 4:02 PM, Cody Precord <codyprecord@gmail.com> wrote:
Hello,
You are running the upload job in the same thread as the gui so it is
blocking the gui from doing the updates to the screen.
Options:
1) You may be able to solve this by adding a call to wx.YieldIfNeeded()
after each time you add text the text control this will make you function
temporarly yield and allow the main thread to check and process any pending
events.
or
2) Move the upload code to a separate thread and post the update messages
back to the main thread for display.
cody
On Fri, Sep 12, 2008 at 3:46 PM, Peter Keane <pkeane@mail.utexas.edu> wrote:
Hello-
I have written a small wxPython application which is a media file
uploader to be used with a custom CSM/DAM we use here at UT Austin.
It uses httplib to "POST" a file to the CMS. The whole thing works
properly, except for the output. I am writing the output to a text
control, and nothing gets written until all of the files have uploaded
(perhaps output is buffered). I would like to have the output display
incrementally in real time. If I simply "print" the output, I see the
proper incremental output on the command line from which I launched
the app, but I cannot get that to work in a text control.