On 24/11/2014 at 13:14, xxxxxxxx wrote:
hey I try to set a progress while downloading a file
u = urlopen('http:/url/'+filename)
It update the dialog after the full download of the file .
On 25/11/2014 at 02:34, xxxxxxxx wrote:
without knowing in which context you are using the above code it is hard to say anything. There are differences in PC and Mac when it comes to redrawing dialogs, please see this thread.
So the most sophisticated solution would be to handle the download in a separate C4DThread. There you could use SpecialEventAdd() to trigger the redraw of the dialog.
On 26/11/2014 at 04:53, xxxxxxxx wrote:
thanks for you reply - I try that :
class RB_Client(c4d.threading.C4DThread) :
def Main(self) :
u = urlopen('url')
buffer = u.read(block_size)
if not buffer:
message2 = str(round(float(downloaded_bytes)/file_size*100-0.5))+" %"
UpdaterDialog.progressmessage = message2
Cthread = RB_Client()
def CoreMessage(self, id, msg) :
return gui.GeDialog.CoreMessage(self, id, msg)
the dialog refresh after the end of the function not during the while
On 27/11/2014 at 02:23, xxxxxxxx wrote:
maybe your thread works too fast for Cinema to send the messages. You could add a sleep() call from the time lib in your while loop to give Cinema a chance to send the message.
Alternatively you can use SetTimer() and Timer() in your GeDialog so the dialog will update continuously independent from any thread message.
On 05/12/2014 at 08:24, xxxxxxxx wrote:
was your question answered?
On 06/12/2014 at 07:55, xxxxxxxx wrote: