From b7deed9ce4c24002487dc9ea877477ee75320b71 Mon Sep 17 00:00:00 2001 From: ken Date: Thu, 20 Jun 2024 17:48:28 -0700 Subject: [PATCH] Replace "Current" with a "Completed" status (when final) --- Fill.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Fill.py b/Fill.py index 384582d2b5a6..7d4dea0da2e8 100644 --- a/Fill.py +++ b/Fill.py @@ -41,8 +41,9 @@ def log_fill_progress(self, name: str, placed: int, final: bool = False) -> None # any non-CLI logging; just log 10x times (or fewer), no need for anything fancy def log_nontty(self, name: str, placed: int, final: bool) -> None: if final or placed % self.step == 0: + status: str = "Finished" if final else "Current" pct: float = round(100 * (placed / self.total_items), 2) - logging.info(f"Current fill step ({name}) at {placed}/{self.total_items} ({pct}%) items placed.") + logging.info(f"{status} fill step ({name}) at {placed}/{self.total_items} ({pct}%) items placed.") # on CLI, be a little friendlier def log_tty(self, name: str, placed: int, final: bool) -> None: @@ -60,9 +61,10 @@ def log_tty(self, name: str, placed: int, final: bool) -> None: if not final: logging.StreamHandler.terminator = '\r' + status: str = "Finished" if final else "Current" pct: float = round(100 * (placed / self.total_items), 2) elapsed: str = time.strftime("%Hh:%Mm:%Ss", time.gmtime(round(self.cur_time - self.start_time))) - logging.info(f"Current fill step ({name}) at {placed}/{self.total_items} ({pct}%) items placed [{elapsed} elapsed].") + logging.info(f"{status} fill step ({name}) at {placed}/{self.total_items} ({pct}%) items placed [{elapsed} elapsed].") # restore the terminator logging.StreamHandler.terminator = old_term