'Updates the progress bar to a new value.'

def update(self, value):

    assert (0 <= value <= self.maxval)
    self.currval = value
    if ((not self._need_update()) or self.finished):
        return
    if (not self.start_time):
        self.start_time = time.time()
    self.seconds_elapsed = (time.time() - self.start_time)
    self.prev_percentage = self.percentage()
    if (value == self.maxval):
        self.finished = True
