GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs(readme): gradient percentage on the plain race lane, history wor… · wolph/python-progressbar@c10b76b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • README.md
  • docs/_static/demos
    • readme-race.svg
  • scripts
    • render_race.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+3-4Lines changed: 3 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,9 @@ if __name__ == '__main__':
380380
The features above are the flashy half. The other half is why the
381381
package has survived since 2012:
382382

383-
- Maintained since February 2012, with 111 releases on PyPI since
384-
2013. The lineage goes back further: this is the continuation of the
385-
original `progressbar` package, on PyPI since 2006, and it still
386-
works as a drop-in replacement for it.
383+
- Supported non-stop since 2012, with 111 releases on PyPI, and since
384+
2008 before that as the original `progressbar` library, which
385+
progressbar2 still replaces drop-in.
387386
- 1131 tests at 100% branch coverage, enforced in CI on every commit.
388387
- Fully typed (PEP 561 `py.typed`), so your type checker sees the real
389388
signatures.
Collapse file

‎docs/_static/demos/readme-race.svg‎

Copy file name to clipboardExpand all lines: docs/_static/demos/readme-race.svg
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Loading
Collapse file

‎scripts/render_race.py‎

Copy file name to clipboardExpand all lines: scripts/render_race.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ def race_frames(results: dict[str, typing.Any]) -> list[list[str]]:
141141
fraction = min(1.0, t / total)
142142
filled = round(fraction * BAR_WIDTH)
143143
pct = f'{fraction * 100:3.0f}%'
144+
if lane == 'progressbar2':
145+
# The full bar's default widgets color the percentage
146+
# readout with the red->green progress gradient
147+
# (widgets.Bar's `fg=colors.gradient` default), so the
148+
# plain lane wears that here too. The fill stays plain
149+
# '#', which is also faithful to the default look.
150+
pct = f'{_sgr(*_gradient_rgb(fraction))}{pct}{RESET}'
144151
suffix = f' {total * 1000:.1f} ms' if fraction >= 1.0 else ''
145152
lines.append(
146153
f'{RESET}{lane:<{LABEL_WIDTH}} {pct} '

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.