Return configured progress bar helper.

@param int $maxSteps
@param \Symfony\Component\Console\Output\OutputInterface $output

@return \Symfony\Component\Console\Helper\ProgressBar
172641
protected function getProgressBar($maxSteps, OutputInterface $output)
    {
        $progressBar = new ProgressBar($output, $maxSteps);
        $progressBar->setFormat(
            ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%'
        );

        return $progressBar;
    }
497193
protected function _progressBar()
    {
        if ($this->_current > $this->_total) {
            return;
        }

        $percent = $this->_current / $this->_total;
        $nb = $percent * $this->_size;

        $b = str_repeat($this->_chars['bar'], floor($nb));
        $i = '';

        if ($nb < $this->_size) {
            $i = str_pad($this->_chars['indicator'], $this->_size - strlen($b));
        }

        $p = floor($percent * 100);

        $string = Text::insert($this->_format, compact('p', 'b', 'i'));

        $this->write("\r" . $string, $this->_color);
    }
582658
def progress_bar(name, maxval, prefix='Converting'):
    
    widgets = ['{} {}: '.format(prefix, name), Percentage(), ' ',
               Bar(marker='=', left='[', right=']'), ' ', ETA()]
    bar = ProgressBar(widgets=widgets, max_value=maxval, fd=sys.stdout).start()
    try:
        yield bar
    finally:
        bar.update(maxval)
        bar.finish()
984226
public function progressBarCommand(): void
    {
        $i     = 0;
        $total = 120;
        $bar   = new ProgressBar();
        $bar->start(120);

        while ($i <= $total) {
            $bar->advance();
            usleep(50000);
            $i++;
        }

        $bar->finish();
    }
983321
public function printStepList(OutputPrinter $printer, $intro, $resultCode, array $stepStats)
    {
        if (!count($stepStats)) {
            return;
        }

        $style = $this->resultConverter->convertResultCodeToString($resultCode);
        $intro = $this->translator->trans($intro, array(), 'output');

        $printer->writeln(sprintf('--- {+%s}%s{-%s}' . PHP_EOL, $style, $intro, $style));

        foreach ($stepStats as $num => $stepStat) {
            if ($stepStat instanceof StepStatV2) {
                $this->printStepStat($printer, $num + 1, $stepStat, $style);
            } elseif ($stepStat instanceof StepStat) {
                $this->printStat($printer, $stepStat->getText(), $stepStat->getPath(), $style, $stepStat->getStdOut(), $stepStat->getError());
            }
        }
    }
1261964
public void updateProgress(int progress, int maxProgress) {
		int increment = (int)((double)(stopValue - startValue) * ((double)maxProgress / (double)progress));
		progressBar.setValue(startValue + increment);
	}
389477
public function finish(): void
    {
        if (!$this->started) {
            throw new \LogicException('Progress bar has not yet been started.');
        }

        if (!$this->maxSteps) {
            $this->maxSteps = $this->step;
        }

        if ($this->step === $this->maxSteps && !$this->overwrite) {
            // prevent double 100% output
            return;
        }

        $this->finishTime = time();
        $this->advanceTo($this->maxSteps);

        $this->output->write('');
    }
1119860
public function start($max = null)
    {
        $this->max = (int) $max;
        $this->progress->start($this->output, $max);
    }
142335
private void updateProgressBar(Progress prog, JProgressBar pbar) {
    if(prog instanceof FiniteProgress) {
      pbar.setValue(((FiniteProgress) prog).getProcessed());
      pbar.setString(((FiniteProgress) prog).toString());
    }
    else if(prog instanceof IndefiniteProgress) {
      pbar.setValue(((IndefiniteProgress) prog).getProcessed());
      pbar.setString(((IndefiniteProgress) prog).toString());
    }
    else if(prog instanceof MutableProgress) {
      pbar.setValue(((MutableProgress) prog).getProcessed());
      pbar.setMaximum(((MutableProgress) prog).getProcessed());
      pbar.setString(((MutableProgress) prog).toString());
    }
    else {
      throw new RuntimeException("Unsupported progress record");
    }
  }
1139286
public function start($message, $maxSteps)
    {
        $this->info($message);

        if ($this->progressBar instanceof ProgressBar) {
            $this->progressBar->setMessage($message);
            $this->progressBar->start($maxSteps);
        }
    }
1204337
public function export_for_template(\renderer_base $output) {
        $result = (object) [
            'name'  => $this->tour->get_tour_key(),
            'steps' => [],
        ];

        foreach ($this->tour->get_steps() as $step) {
            $result->steps[] = (new step($step))->export_for_template($output);
        }

        return $result;
    }
673309
protected function getTable(OutputInterface $output)
    {
        if (!\class_exists('Symfony\Component\Console\Helper\Table')) {
            return $this->getTableHelper();
        }

        $style = new TableStyle();
        $style
            ->setVerticalBorderChar(' ')
            ->setHorizontalBorderChar('')
            ->setCrossingChar('');

        $table = new Table($output);

        return $table
            ->setRows([])
            ->setStyle($style);
    }
484330
protected function getProgressBar(InputInterface $input)
    {
        $progress = parent::getProgressBar($input);
        if (!$progress) {
            return null;
        }

        $this->getService('event_dispatcher')->addListener(
            'parser.file.pre',
            function (PreFileEvent $event) use ($progress) {
                $progress->advance();
            }
        );

        return $progress;
    }
331527
protected function renderProgressBar($percent1, $percent2 = 0, $offset = 0)
    {
        $percent1 = round(max(1, $percent1));
        $offset = round(max(0, $offset));
        $offset = round(min(99, $offset));

        $output = '<div class="progress">';
        $output .= '<div class="progress-bar">';
        $output .= '<div class="progress-bar1" style="width: ' . $percent1 . '%; margin-left: ' . $offset . '%;"></div>';

        if ($percent2 > 0) {
            $percent2 = round(max(1, $percent2));
            if ($percent1 + $percent2 + $offset > 100) {
                // preventing line break in css progress bar if widths and margins are bigger than 100%
                $percent2 = 100 - $percent1 - $offset;
                $percent2 = max(0, $percent2);
            }
            $output .= '<div class="progress-bar2" style="width: ' . $percent2 . '%"></div>';
        }

        $output .= '</div>';
        $output .= '</div>';
        return $output;
    }
1223803
private function getProgressBar(OutputInterface $output)
    {
        $bar = new ProgressBar($output);
        $bar->setFormat(' %current%/%max% [%bar%] %percent:3s%% %memory:6s%');
        $bar->setBarCharacter('<comment>=</comment>');
        $bar->setEmptyBarCharacter(' ');
        $bar->setProgressCharacter('|');
        $bar->setBarWidth(50);

        return $bar;
    }
939880
public static function from(int $min, int $max, int $step): self
    {
        return new self(Size::from($min), Size::from($max), Size::from($step));
    }
742474
public void setProgressAndMax(int progress, int max) {
    if (progress > max || progress < 0) {
      throw new IllegalArgumentException(
          String.format("Progress (%d) must be between %d and %d", progress, 0, max));
    } else if (max <= 0) {
      throw new IllegalArgumentException(String.format("Max (%d) must be > 0", max));
    }

    mProgress = progress;
    mMax = max;
    invalidate();
  }