Ejemplo n.º 1
0
    def __init__(self,
                 iterable,
                 length=None,
                 fill_char='#',
                 empty_char=' ',
                 bar_template='%(bar)s',
                 info_sep='  ',
                 show_eta=True,
                 show_percent=None,
                 show_pos=False,
                 item_show_func=None,
                 label=None,
                 file=None,
                 color=None,
                 width=30):

        # If the file is not a tty we don't need any control symbols.
        if file and not file.isatty():
            click._termui_impl.BEFORE_BAR = ''
            click._termui_impl.AFTER_BAR = ''

        ProgressBar.__init__(self, iterable, length, fill_char, empty_char,
                             bar_template, info_sep, show_eta, show_percent,
                             show_pos, item_show_func, label, file, color,
                             width)

        # This progress bar is never hidden
        self.is_hidden = False
Ejemplo n.º 2
0
 def __init__(self, iterable, length=None, fill_char='#', empty_char=' ',
              bar_template='%(bar)s', info_sep='  ', show_eta=True,
              show_percent=None, show_pos=False, item_show_func=None,
              label=None, file=None, color=None, width=30,  # @ReservedAssignment
              start_show_func=None, finish_show_func=None):
     """
     New parameters added on top of ProgressBar: start_show_func and
     finish_show_func to drive some display at the start and finish of a
     progression.
     """
     ProgressBar.__init__(self, iterable, length=length, fill_char=fill_char,
                          empty_char=empty_char, bar_template=bar_template,
                          info_sep=info_sep, show_eta=show_eta,
                          show_percent=show_percent, show_pos=show_pos,
                          item_show_func=item_show_func, label=label,
                          file=file, color=color, width=width)
     self.start_show_func = start_show_func
     self.finish_show_func = finish_show_func