'Update the progress bar to the given value (out of the total
given to the constructor).'

def _update_console(self, value=None):

    if (self._total == 0):
        frac = 1.0
    else:
        frac = (float(value) / float(self._total))
    file = self._file
    write = file.write
    if (frac > 1):
        bar_fill = int(self._bar_length)
    else:
        bar_fill = int((float(self._bar_length) * frac))
    write(u'\r|')
    color_print((u'=' * bar_fill), u'blue', file=file, end=u'')
    if (bar_fill < self._bar_length):
        color_print(u'>', u'green', file=file, end=u'')
        write((u'-' * ((self._bar_length - bar_fill) - 1)))
    write(u'|')
    if (value >= self._total):
        t = (time.time() - self._start_time)
        prefix = u'                    '
    elif (value <= 0):
        t = None
        prefix = u''
    else:
        t = (((time.time() - self._start_time) * (1.0 - frac)) / frac)
        prefix = u'    ETA    '
    write(u'    {0:>4s}/{1:>4s}'.format(human_file_size(value), self._human_total))
    write(u'    ({:>6.2%})'.format(frac))
    write(prefix)
    if (t is not None):
        write(human_time(t))
    self._file.flush()
