def downloadProgress(self,progress, status, filename, size): if status == 0: sys.stdout.write(" Downloading file: '"+filename+"' "+str(size)+"\n\t% 000") sys.stdout.flush() elif status==1: if progress > 0: sys.stdout.write("\b\b\b") sys.stdout.write( "%03i" % progress) sys.stdout.flush() elif status==2: sys.stdout.write("\b\b\b") print "100" print " [Finished]\n" sys.stdout.flush() elif status==-1: print "\n Download failed!" sys.stdout.flush() return True