Display the progress of something: start|end|percent
549873
def progress(rest):
	""
	if rest:
		left, right, amount = [piece.strip() for piece in rest.split('|')]
		ticks = min(int(round(float(amount) / 10)), 10)
		bar = "=" * ticks
		return "%s [%-10s] %s" % (left, bar, right)
422395
def progress(self):
        
        total = len(self.all_jobs)
        remaining = total - len(self.active_jobs) if total > 0 else 0
        percent = int(100 * (float(remaining) / total)) if total > 0 else 0
        return percent
911268
function (e, data) {
                var progress = parseInt(data.loaded / data.total * 100, 10);

                $timeout(function() {
                  ctrl.coreWistia.setProgress(progress);
                });
              }
1183382
def _progress_print(self, sent, total):
        
        percent = min(int(sent*100.0/total), 100)
        sys.stdout.write('\r{0}[{1}{2}] {3}{4}%{5}'.
                         format(color.Green, '#'*(percent/2), ' '*(50-percent/2), color.Yellow, percent, color.Normal))
        sys.stdout.flush()
1064347
def get_progress(self):
        

        count_remaining = len(self.items_queued) + len(self.items_in_progress)
        percentage_remaining = 100 / self.count_total * count_remaining

        return 100 - percentage_remaining
242348
def progress_indicator(self, fmt=None, interval=100, values=None):
        
        return ProgressIndicator(self.io, fmt, interval, values)
360880
function calculProgress(navigation, current) {
    var n = _.size(navigation);
    var percent = 0, prevPercent = 0, currentChapter = null;
    var done = true;

    var chapters = _.chain(navigation)

    // Transform as array
    .map(function(nav, path) {
        nav.path = path;
        return nav;
    })

    // Sort entries
    .sortBy(function(nav) {
        return nav.index;
    })

    .map(function(nav, i) {
        // Calcul percent
        nav.percent = (i * 100) / Math.max((n - 1), 1);

        // Is it done
        nav.done = done;
        if (nav.path == current) {
            currentChapter = nav;
            percent = nav.percent;
            done = false;
        } else if (done) {
            prevPercent = nav.percent;
        }

        return nav;
    })
    .value();

    return {
        // Previous percent
        prevPercent: prevPercent,

        // Current percent
        percent: percent,

        // List of chapter with progress
        chapters: chapters,

        // Current chapter
        current: currentChapter
    };
}
1241086
def log_percent(self):
        
        done = self.total - self.todo
        percent = int(float(done) / self.total * 100)
        if not hasattr(self, 'prev_percent'):  # first time
            self.prev_percent = 0
            self.progress('Sent %s of data in %d %s task(s)',
                          humansize(self.sent.sum()), self.total, self.name)
        elif percent > self.prev_percent:
            self.progress('%s %3d%% [of %d tasks]',
                          self.name, percent, len(self.tasks))
            self.prev_percent = percent
        return done
1342228
private void showProgress() {

        removeContent();
        displayDialogInfo(
            org.opencms.gwt.client.Messages.get().key(org.opencms.gwt.client.Messages.GUI_UPLOAD_INFO_UPLOADING_0),
            false);
        m_selectionSummary.removeFromParent();
        List<String> files = new ArrayList<String>(getFilesToUpload().keySet());
        Collections.sort(files, String.CASE_INSENSITIVE_ORDER);
        m_progressInfo = new CmsUploadProgressInfo(files);
        m_progressInfo.setContentLength(m_contentLength);
        m_contentWrapper.add(m_progressInfo);
        m_updateProgressTimer.scheduleRepeating(UPDATE_PROGRESS_INTERVALL);
        startLoadingAnimation(Messages.get().key(Messages.GUI_UPLOAD_CLIENT_LOADING_0), 0);
        setHeight();
        changeHeight();
    }
222816
def set_progress_brackets(self, start, end):
        """"""
        self.sep_start = start
        self.sep_end = end
689376
@Override
    public void indicateProgress(int number) {
        verifySystemOut();
        progressIndicatorActive = true;
        String currMsg = lastMessage;
        try {
            if (isAnsiEnabled()) {
                updateStatus(currMsg + ' ' + number);
            } else {
                out.print("..");
                out.print(number);
            }
        } finally {
            lastMessage = currMsg;
        }
    }
323227
@Override
    public void indicateProgress(int number, int total) {
        progressIndicatorActive = true;
        String currMsg = lastMessage;
        try {
            updateStatus(currMsg + ' ' + number + " of " + total);
        } finally {
            lastMessage = currMsg;
        }
    }
1339733
def _progress_hook(self, blocknum, blocksize, totalsize):
        
        read = blocknum * blocksize
        if totalsize > 0:
            percent = read * 1e2 / totalsize
            s = "\r%d%% %*d / %d" % (
                percent, len(str(totalsize)), read, totalsize)
            sys.stdout.write(s)

            if read >= totalsize:
                sys.stdout.write("\n")
        else:
            sys.stdout.write("read %d\n" % read)
1130682
def do_status_progress(p, hide=False):
  
  p.start(10)

  for i in range(1, 60):
    p.progress_inc(new_status="count %s" % i)
    time.sleep(0.1)

  p.stop(hide_progress=hide, new_status="done")
153780
def update_progress(cls, progress, starttime):
        
        width, _height = click.get_terminal_size()
        if not width:
            return

        duration = datetime.utcnow() - starttime
        hours, remainder = divmod(duration.seconds, 3600)
        minutes, seconds = divmod(remainder, 60)

        size = int(width * .6)
        status = ""
        if isinstance(progress, int):
            progress = float(progress)
        if not isinstance(progress, float):
            progress = 0
            status = 'error: progress var must be float\n'
            cls.echo(type(progress))
        if progress < 0:
            progress = 0
            status = 'Halt...\n'
        if progress >= 1:
            progress = 1
            # status = 'Done...\n'
        block = int(round(size * progress))
        text = ('\rProgress: [{0}] {1:.2%} {2} {3:0>2}:{4:0>2}:{5:0>2}  '
                ''.format('#' * block + '-' * (size - block), progress,
                          status, hours, minutes, seconds))
        sys.stdout.write(text)
        sys.stdout.flush()
1191041
def progress(iterator, enum=False, length=None):
    
    progress = ProgressBar()
    length = len(iterator) if length is None else length
    gen = enumerate(iterator)
    while True:
        i, val = next(gen)
        progress((i+1.0)/length * 100)
        if enum:
            yield i, val
        else:
            yield val
988807
def show_progress(self, message=None):
        """'"""
        if self.in_progress_hanging:
            if message is None:
                sys.stdout.write('.')
                sys.stdout.flush()
            else:
                if self.last_message:
                    padding = ' ' * max(0, len(self.last_message)-len(message))
                else:
                    padding = ''
                sys.stdout.write('\r%s%s%s%s' % (' '*self.indent, self.in_progress, message, padding))
                sys.stdout.flush()
                self.last_message = message