Skip to content
Myr

Fixed a bug with autowidth on progress bars.

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

authored by Armin Ronacher · committed by Armin Ronacher · parent cf8f1b7 · Browse files · 2 files+7 added−1 removed
This commit

State

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

Diff stats

2 files+7 added−1 removed

  • other:+7 added−1 removed

2 files+7 added−1 removed

modified:click/_termui_impl.py+1 added-1 removed
154 unmodified lines
155 else:156 if self.finished:157 bar = self.fill_char * self.width158 else:159 bar = list(self.empty_char * self.width)159 bar = list(self.empty_char * (self.width or 1))160 if self.time_per_iteration != 0:161 bar[int((math.cos(self.pos * self.time_per_iteration)162 / 2.0 + 0.5) * self.width)] = self.fill_char163 bar = ''.join(bar)
324 unmodified lines
modified:examples/termui/termui.py+6 added
67 unmodified lines
68 empty_char=' ') as bar:69 for item in bar:70 process_slowly(item)7172 with click.progressbar(length=count, width=0, show_percent=False,73 show_eta=False,74 fill_char=click.style('#', fg='magenta')) as bar:75 for item in bar:76 process_slowly(item)777879@cli.command()80@click.argument('url')81def open(url):82 """Opens a file or URL In the default application."""
29 unmodified lines