Skip to content
Myr

Progress bars no longer displayed if total time since start < 0.5s

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by con-f-use · committed by con-f-use · parent 0a7e6ef · Browse files · 1 file+7 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−2 removed

  • other:+7 added−2 removed

1 file+7 added−2 removed

modified:click/_termui_impl.py+7 added-2 removed
86 unmodified lines
87 self.entered = False88 self.current_item = None89 self.is_hidden = not isatty(self.file)90 self._last_line = None91 self.short_limit = 0.59293 def __enter__(self):94 self.entered = True95 self.render_progress()
7 unmodified lines
103 raise RuntimeError('You need to use progress bars in a with block.')104 self.render_progress()105 return self106107 def is_fast(self):108 return time.time() - self.start <= self.short_limit109110 def render_finish(self):107 if self.is_hidden:111 if self.is_hidden or self.is_fast():112 return113 self.file.write(AFTER_BAR)114 self.file.flush()115
112 unmodified lines
228 buf.append(' ' * (clear_width - line_len))229 line = ''.join(buf)230231 # Render the line only if it changed.232228 if line != self._last_line:233 if line != self._last_line and not self.is_fast():234 self._last_line = line235 echo(line, file=self.file, color=self.color, nl=nl)236 self.file.flush()237
315 unmodified lines