def __enter__(self): if self.show_progress: pg = ProgressBar(self.iter,**(self.kwargs), empty_char='-', bar_template='%(label)s [%(bar)s] %(info)s', width=36) pg.__enter__() return pg return self.iter
def __enter__(self): from blueshift.utils.helpers import if_notebook if if_notebook(): return self.iter if self.show_progress: pg = ProgressBar(self.iter, **(self.kwargs), empty_char='-', bar_template='%(label)s [%(bar)s] %(info)s', width=36) pg.__enter__() return pg return self.iter
def __enter__(self): self.render_start() return ProgressBar.__enter__(self)