A progess bar dialog.
    Optionally a `title`, `ticks` and `label` can be provided.

    ::

        from fontParts.ui import ProgressBar

        bar = ProgressBar()
        # do something
        bar.close()
6221
def ProgressBar(title="RoboFab...", ticks=None, label=""):
    
    return dispatcher["ProgressBar"](title=title, ticks=ticks, label=label)
213863
def render(self):
        
        elements = [self.render_element(e) for e in self.widgets]
        progressbar = self.separator.join(elements)
        width = get_terminal_width()
        if width:
            # leave last column for cursor
            progressbar = progressbar.ljust(width - 1)
        return progressbar
259041
private void removeProgressBar(Progress prog, JProgressBar pbar) {
    synchronized(pbarmap) {
      pbarmap.remove(prog);
      SwingUtilities.invokeLater(() -> removeProgressBar(pbar));
    }
  }
988861
def show(self):
        """"""

        if len(self.text) > self.textwidth:
            label = self.text[0:self.textwidth]
        else:
            label = self.text.rjust(self.textwidth)

        terminalSize = getTerminalSize()
        if terminalSize is None:
            terminalSize = 80
        else:
            terminalSize = terminalSize[1]

        barWidth = terminalSize - self.textwidth - 10

        if self.value is None or self.value < 0:
            pattern = self.twiddle_sequence[
                self.twiddle % len(self.twiddle_sequence)]
            self.twiddle += 1
            barSymbols = (pattern * int(math.ceil(barWidth/3.0)))[0:barWidth]
            progressFractionText = '   . %'
        else:
            progressFraction = float(self.value) / self.max

            nBlocksFrac, nBlocksInt = math.modf(
                max(0.0, min(1.0, progressFraction)) * barWidth)
            nBlocksInt = int(nBlocksInt)

            partialBlock = self.sequence[
                int(math.floor(nBlocksFrac * len(self.sequence)))]

            nBlanks = barWidth - nBlocksInt - 1
            barSymbols = (self.sequence[-1] * nBlocksInt) + partialBlock + \
                (self.sequence[0] * nBlanks)
            barSymbols = barSymbols[:barWidth]
            progressFractionText = ('%.1f%%' % (100*progressFraction)).rjust(6)

        print >>self.fid, '\r\x1B[1m' + label + '\x1B[0m [' + barSymbols + \
            ']' + progressFractionText,
        self.fid.flush()
        self.linefed = False
1258090
private void printProgressBar() {

    double x;

    this.out.print("\r");
    this.out.print(PROGRESS_BAR_END_CHAR);

    for (int i = 1; i <= this.length; i++) {

      if (!Double.isNaN(this.progress)) {

        x = (double) i / this.length;
        this.out.print(this.progress >= x ? PROGRESS_BAR_CHAR : PROGRESS_BACKGROUND_CHAR);

      } else { // Double.isNaN(progress)

        this.out.print(PROGRESS_BAR_INDETERMINANT_CHAR);

      }

    }

    this.out.print(PROGRESS_BAR_END_CHAR);

    if (this.maximum > 0) {
      this.out.printf(" (%d/%d)", value, maximum);
    }

    this.out.print(" ");
    this.out.print(status);

  }
604694
private void defineProgressBars(UIDefaults d) {
        // Copied from nimbus

      //Initialize ProgressBar
        d.put("ProgressBar.contentMargins", new InsetsUIResource(0, 0, 0, 0));
        d.put("ProgressBar.States", "Enabled,Disabled,Indeterminate,Finished");
        d.put("ProgressBar.tileWhenIndeterminate", Boolean.TRUE);
        d.put("ProgressBar.paintOutsideClip", Boolean.TRUE);
        d.put("ProgressBar.rotateText", Boolean.TRUE);
        d.put("ProgressBar.vertictalSize", new DimensionUIResource(19, 150));
        d.put("ProgressBar.horizontalSize", new DimensionUIResource(150, 19));
        addColor(d, "ProgressBar[Disabled].textForeground", "seaGlassDisabledText", 0.0f, 0.0f, 0.0f, 0);
        d.put("ProgressBar[Disabled+Indeterminate].progressPadding", new Integer(3));
        
        // Seaglass starts below.
        
        d.put("progressBarTrackInterior", Color.WHITE);
        d.put("progressBarTrackBase", new Color(0x4076bf));

        d.put("ProgressBar.Indeterminate", new ProgressBarIndeterminateState());
        d.put("ProgressBar.Finished", new ProgressBarFinishedState());

        String p = "ProgressBar";
        String c = PAINTER_PREFIX + "ProgressBarPainter";

        d.put(p + ".cycleTime", 500);
        d.put(p + ".progressPadding", new Integer(3));
        d.put(p + ".trackThickness", new Integer(19));
        d.put(p + ".tileWidth", new Integer(24));
        d.put(p + ".backgroundFillColor", Color.WHITE);
        d.put(p + ".font", new DerivedFont("defaultFont", 0.769f, null, null));
        d.put(p + "[Enabled].backgroundPainter", new LazyPainter(c, ProgressBarPainter.Which.BACKGROUND_ENABLED));
        d.put(p + "[Disabled].backgroundPainter", new LazyPainter(c, ProgressBarPainter.Which.BACKGROUND_DISABLED));
        d.put(p + "[Enabled].foregroundPainter", new LazyPainter(c, ProgressBarPainter.Which.FOREGROUND_ENABLED));
        d.put(p + "[Enabled+Finished].foregroundPainter",
              new LazyPainter(c, ProgressBarPainter.Which.FOREGROUND_ENABLED_FINISHED));
        d.put(p + "[Enabled+Indeterminate].foregroundPainter",
              new LazyPainter(c, ProgressBarPainter.Which.FOREGROUND_ENABLED_INDETERMINATE));
        d.put(p + "[Disabled].foregroundPainter", new LazyPainter(c, ProgressBarPainter.Which.FOREGROUND_DISABLED));
        d.put(p + "[Disabled+Finished].foregroundPainter",
              new LazyPainter(c, ProgressBarPainter.Which.FOREGROUND_DISABLED_FINISHED));
        d.put(p + "[Disabled+Indeterminate].foregroundPainter",
              new LazyPainter(c, ProgressBarPainter.Which.FOREGROUND_DISABLED_INDETERMINATE));
    }
567515
def progress(self, *msg):
        
        label = colors.purple("Progress")
        self._msg(label, *msg)
1278436
def format_bar(self):
        
        pct = floor(round(self.progress/self.size, 2)*100)
        pr = floor(pct*.33)
        bar = "".join(
            ["‒" for x in range(pr)] + ["↦"] +
            [" " for o in range(self._barsize-pr-1)])
        subprogress = self.format_parent_bar() if self.parent_bar else ""
        message = "Loading{} ={}{} ({}%)".format(subprogress, bar, "☉", pct)
        return message.ljust(len(message)+5)
613509
def OnFontDialog(self, event):
        """"""

        # Get current font data from current cell
        cursor = self.main_window.grid.actions.cursor
        attr = self.main_window.grid.code_array.cell_attributes[cursor]

        size, style, weight, font = \
            [attr[name] for name in ["pointsize", "fontstyle", "fontweight",
                                     "textfont"]]
        current_font = wx.Font(int(size), -1, style, weight, 0, font)

        # Get Font from dialog

        fontdata = wx.FontData()
        fontdata.EnableEffects(True)
        fontdata.SetInitialFont(current_font)

        dlg = wx.FontDialog(self.main_window, fontdata)

        if dlg.ShowModal() == wx.ID_OK:
            fontdata = dlg.GetFontData()
            font = fontdata.GetChosenFont()

            post_command_event(self.main_window, self.main_window.FontMsg,
                               font=font.FaceName)
            post_command_event(self.main_window, self.main_window.FontSizeMsg,
                               size=font.GetPointSize())

            post_command_event(self.main_window, self.main_window.FontBoldMsg,
                               weight=font.GetWeightString())
            post_command_event(self.main_window,
                               self.main_window.FontItalicsMsg,
                               style=font.GetStyleString())

            if is_gtk():
                try:
                    wx.Yield()
                except:
                    pass

            self.main_window.grid.update_attribute_toolbar()
203099
def progressbar(
		iterable=None, length=None, label=None,
		show_eta=True, show_percent=None, show_pos=False, item_show_func=None,
		fill_char='#', empty_char='-', bar_template='%(label)s [%(bar)s] %(info)s', info_sep=' ',
		width=36, file=None, color=None):
	""""""
	
	try:
		return IPyBackend(iterable, length, label=label,
			show_eta=show_eta, show_percent=show_percent, show_pos=show_pos,
			item_show_func=item_show_func, info_sep=info_sep)
	except (ImportError, RuntimeError): #fall back if ipython is not installed or no notebook is running
		return click.progressbar(
			iterable, length, label,
			show_eta, show_percent, show_pos, item_show_func,
			fill_char, empty_char, bar_template, info_sep,
			width, file, color)
1297478
def progress_bar(items_total, items_progress, columns=40, base_char='.', progress_char='#', percentage=False, prefix='', postfix=''):
    
    bins_total = int(float(items_total) / columns) + 1
    bins_progress = int((float(items_progress) / float(items_total)) * bins_total) + 1
    progress = prefix
    progress += progress_char * bins_progress
    progress += base_char * (bins_total - bins_progress)
    if percentage:
        progress_percentage = float(items_progress) / float(items_total) * 100
        # Round the percentage to two decimals
        postfix = ' ' + str(round(progress_percentage, 2)) + '% ' + postfix
    progress += postfix
    return progress
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);
    }
1172043
def yticktext(self, labels, index=1):
        
        self.layout['yaxis' + str(index)]['ticktext'] = labels
        return self
583767
function (progress) {
			var _this = this;
			this.progressBar.animate({
				value: progress
			}, 1, function() {
				_this.onProgress(progress);
			});
			this.progress = progress;
		}
476406
def title(cls, message=None):
        ''''''
        if message == None:
            return getproctitle()
        else:
            setproctitle('qless-py-worker %s' % message)
            logger.info(message)
804200
def bar(self, progress):
        """"""
        if not hasattr(self, "_limit") or not self._limit:
            self._limit = self.terminal_size()
        graph_progress = int(progress * self._limit)
        self.stdout.write('\r', ending='')
        progress_format = "[%-{}s] %d%%".format(self._limit)
        self.stdout.write(
            self.style.SUCCESS(progress_format % (self.progress_symbol * graph_progress, int(progress * 100))),
            ending=''
        )
        self.stdout.flush()
29909
def display_dialog(self, *args, **kwargs):
        """"""
        form = kwargs.pop('form_instance', None)
        success_message = kwargs.pop('success_message', None)

        if not form:
            form = self.get_form_class()(initial=kwargs, instance=self.object)

        if not hasattr(form, "helper"):
            form.helper = FormHelper()
        form.helper.form_tag = False

        return {
            'title': self.title.format(
                model_name=self.get_model_config().model_name,
                object=str(self.object) if self.object else '',
            ),
            'content': self.render_to_string(self.template, {
                'form': form,
                'success_message': success_message,
            }),
            'submit_label': self.submit_label,
            'success': bool(success_message),
        }