Skip to content

Commit b6707a0

Browse files
authored
Merge pull request #17 from tmck-code/pbar-use-space
use space char & bg color for progress bar
2 parents 7d8b063 + 7b55e44 commit b6707a0

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -euo pipefail
44

laser_prynter/pbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, total: int, c1: RGB = DEFAULT_C1, c2: RGB = DEFAULT_C2):
4545
def _initial_bar(self) -> None:
4646
"print initial bar in end color"
4747
print(
48-
f'\x1b[38;2;{self.c2.r};{self.c2.g};{self.c2.b}m' + '' * self.w + '\x1b[0m',
48+
f'\x1b[48;2;{self.c2.r};{self.c2.g};{self.c2.b}m' + ' ' * self.w + '\x1b[0m',
4949
end='',
5050
flush=True,
5151
)
@@ -73,7 +73,7 @@ def __iter__(self) -> PBar:
7373

7474
def __next__(self) -> None:
7575
for i, rgb in next(self._iter_pbar):
76-
print(f'\x1b[38;2;{int(rgb.r)};{int(rgb.g)};{int(rgb.b)}m\x1b[0m', end='', flush=True)
76+
print(f'\x1b[48;2;{int(rgb.r)};{int(rgb.g)};{int(rgb.b)}m \x1b[0m', end='', flush=True)
7777
self.curr = i
7878
if self.curr >= self.w:
7979
raise StopIteration

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "laser-prynter"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
authors = [{ name = "tmck-code", email = "tmck01@gmail.com" }]
55
description = "terminal/cli/python helpers for colour and pretty-printing"
66
readme = "README.md"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)