コード例 #1
0
 def getstring(self):
     speed = int(self.state * self.size / 100.0 /
                 (time.time() - self.starttime))
     eta = (100 - self.state) * self.size / 100.0 / speed
     return ConsoleProgressBar.getstring(
         self) + "  %s  %12s/s  %3i:%02i ETA" % (self.sizeof_fmt(
             self.size), self.sizeof_fmt(speed), eta / 60, eta % 60)
コード例 #2
0
 def __call__(self, *args, **kwargs):
     ret = ConsoleProgressBar.__call__(self, *args, **kwargs)
     if self.redirect:
         self.redirect(self.state)
     return ret
コード例 #3
0
 def getstring(self):
     speed = int(self.state * self.size / 100.0 / (time.time() - self.starttime))
     eta = (100 - self.state) * self.size / 100.0 / speed
     return ConsoleProgressBar.getstring(self) + "  %s  %12s/s  %3i:%02i ETA" % (self.sizeof_fmt(self.size), self.sizeof_fmt(speed), eta/60, eta%60)
コード例 #4
0
 def __init__(self, filename, size):
     print "Downloading", filename
     ConsoleProgressBar.__init__(self, "progress:", 20)
     self.size = size
     self.starttime = time.time()
     self.speed = 0.0
コード例 #5
0
 def __call__(self, *args, **kwargs):
     ret = ConsoleProgressBar.__call__(self, *args, **kwargs)
     if self.redirect:
         self.redirect(self.state)
     return ret
コード例 #6
0
 def __init__(self, filename, size):
     print "Downloading", filename
     ConsoleProgressBar.__init__(self, "progress:", 20)
     self.size = size
     self.starttime = time.time()
     self.speed = 0.0