Is there a trick in forcing the dialog to display the updated values in a
dGauge?
I'm displaying a dialog with a dGauge. Within the code of the dialog I'm
setting the dGauge.Value =+ 1 but the display does not refresh as expected.
I'm attemping to create progress bar for a FTP upload. But the dGauge display
does not update until the upload has completed. I know the callback of the
binary transfer is happening because I placed a "print '.') in the method and
that is displaying in the standard out. See below
class MyProgressBar(dabo.ui.dDialog):
def
__init__(self,parent,thefile,thefileandPath,theagent,thepasswd,thepropertyID):
self.MainForm=parent
self.thefile=thefile
self.thefileandPath=thefileandPath
self.theagent =theagent
self.thepasswd = thepasswd
self.thepropertyID = thepropertyID
super(MyProgressBar, self).__init__(parent=parent,
properties=None)
def afterInitAll(self):
success=self.startTransfer()
if success:
self.Close()
return True
else:
dabo.ui.stop("Sorry a error has occurred if the
condition continues please
contact OzVideoMaster support")
self.Close()
return False
def initProperties(self):
self.BorderResizable=False
self.AutoSize=False
self.ReleaseOnEscape=False
self.Center=True
def afterInit(self):
self.Caption =("Upload Progress")
self.Layout()
def addControls(self):
""" add a dGauge """
self.Sizer = vs = dabo.ui.dSizer("v")
TPlbl = dabo.ui.dLabel(self, Height=25, Caption="Transfer
Progress")
self.theGauge=dabo.ui.dGauge(self,Width=500)
vs.append(TPlbl)
vs.append(self.theGauge)
def handleDownload(self,block):
self.theGauge.Value=+100
self.update()
print '.'
def startTransfer(self): ##, self.thefile,
self.thePath,self.theagent,self.thepassw):
try:
ftphandle =
ftplib('www.xesswealth.net',self.theagent,self.thepasswd)
except:
dabo.ui.stop("Sorry the program cannot connect with
transfer server. If
the condition continues please contact OzVideoMaster support")
return False
try:
transfile = open(self.thefileandPath, "rb")
filesize=os.stat(self.thefileandPath)[6] / 8192
#self.theGauge.Range=filesize
except:
dabo.ui.stop("Sorry the program cannot find the video
to transfer. If the
condition continues please contact OzVideoMaster support")
return False
try: ## special binary transfer with a callback provided
ftphandle.binarytrans('STOR '+self.thepropertyID,transfile,self.handleDownload)
except:
dabo.ui.stop("Sorry the program cannot complete the
transfer to the server.
If the condition continues please contact OzVideoMaster support")
return False
dabo.ui.dMessageBox.showMessageBox("The file was sucessfully
transfered to
the server.","Success", wx.ICON_INFORMATION)
return True
--
John Fabiani
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]