diff --git a/laser_prynter/pbar.py b/laser_prynter/pbar.py index 587a50f..366b1dc 100644 --- a/laser_prynter/pbar.py +++ b/laser_prynter/pbar.py @@ -140,15 +140,17 @@ def _print_info(self) -> None: eta_str = self._format_time((elapsed / self.i) * (self.t - self.i)) pct = (self.i / self.t) * 100 + items_per_sec = self.i / max(elapsed, 0.001) item_info = f'[\x1b[1;32m{self.i}\x1b[0m/{self.t}] \x1b[1;97m{pct:.1f}%\x1b[0m' time_info = f'\x1b[92m+{self._format_time(elapsed)}\x1b[0m \x1b[93m-{eta_str}\x1b[0m' + rate_info = f'\x1b[1;37m{items_per_sec:.2f} it/s\x1b[0m' # Clear the line and print info above the progress bar _print_to_terminal( f'\x1b[{self.h - 1};0H' # move to line above bar '\x1b[2K' # clear entire line - f'{item_info} | {time_info}' - f'\x1b[{self.h - 2};0H' # mo`ve cursor to last line of scrollable area + f'{item_info} | {time_info} ({rate_info})' + f'\x1b[{self.h - 2};0H' # move cursor to last line of scrollable area ) def _print_bar_char(self, s: str, colour: RGBColour, x_pos: int) -> None: diff --git a/pyproject.toml b/pyproject.toml index b3f6fb3..ab86dc6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "laser-prynter" -version = "0.7.0" +version = "0.8.0" authors = [{ name = "tmck-code", email = "tmck01@gmail.com" }] description = "terminal/cli/python helpers for colour and pretty-printing" readme = "README.md" diff --git a/uv.lock b/uv.lock index 0a9bb12..6f62a25 100644 --- a/uv.lock +++ b/uv.lock @@ -4,7 +4,7 @@ requires-python = ">=3.12" [[package]] name = "laser-prynter" -version = "0.7.0" +version = "0.8.0" source = { virtual = "." } dependencies = [ { name = "pygments" },