Example #1
0
 def pulse(self, owner):
     BaseAcquireProgress.pulse(self, owner)
     statusMessage(
         "PULSE items:%d/%d bytes:%.1f/%.1f rate:%.1f elapsed:%d" %
         (self.current_items, self.total_items, self.current_bytes,
          self.total_bytes, self.current_cps, self.elapsed_time))
     return True  # False to cancel the job
Example #2
0
 def pulse(self, owner):
     BaseAcquireProgress.pulse(self, owner)
     statusMessage("PULSE items:%d/%d bytes:%.1f/%.1f rate:%.1f elapsed:%d" % (
           self.current_items, self.total_items, 
           self.current_bytes, self.total_bytes,
           self.current_cps, self.elapsed_time))
     return True # False to cancel the job
Example #3
0
    def pulse(self, owner):
        AcquireProgress.pulse(self, owner)
        current_item = self.current_items + 1
        if current_item > self.total_items:
            current_item = self.total_items
        if self.current_cps > 0:
            text = (_("Downloading file %(current)li of %(total)li with "
                      "%(speed)s/s") % {
                          "current": current_item,
                          "total": self.total_items,
                          "speed": apt_pkg.size_to_str(self.current_cps)
                      })
        else:
            text = (_("Downloading file %(current)li of %(total)li") % {
                "current": current_item,
                "total": self.total_items
            })

        percent = (((self.current_bytes + self.current_items) * 100.0) /
                   float(self.total_bytes + self.total_items))
        self.emit("status-changed", text, percent)
        while self._context.pending():
            self._context.iteration()
        return self._continue