diff --git a/Lib/fontbakery/fbchecklogger.py b/Lib/fontbakery/fbchecklogger.py index d4648a49a1..2bed957850 100644 --- a/Lib/fontbakery/fbchecklogger.py +++ b/Lib/fontbakery/fbchecklogger.py @@ -28,6 +28,7 @@ NORMAL ) class FontBakeryCheckLogger(): + progressbar = False def __init__(self, config): self.config = config @@ -175,6 +176,22 @@ def output_github_markdown_report(self, a_target): ghm_output.write(markdown_data) self.ghm_report_files.append(output_filename) + def update_progressbar(self): + tick = { + "OK": GREEN_STR.format('.'), + "HOTFIX": BLUE_STR.format('H'), + "ERROR": RED_STR.format('E'), + "WARNING": YELLOW_STR.format('W'), + "SKIP": WHITE_STR.format('S'), + "INFO": CYAN_STR.format('I'), + "unknown": RED_STR.format('?') + } + if self.progressbar is False: + return + else: + print(tick[self.current_check["result"]], end='') + sys.stdout.flush() + def flush(self): if self.current_check is not None: if self.current_check["result"] == "unknown": @@ -186,6 +203,7 @@ def flush(self): " https://github.com/googlefonts/fontbakery/issues/new" "\n").format(self.current_check["check_number"])) + self.update_progressbar() check_number = self.current_check["check_number"] self.all_checks[check_number] = self.current_check self.current_check = None diff --git a/bin/fontbakery-check-ttf.py b/bin/fontbakery-check-ttf.py index f042a70f78..242647f617 100755 --- a/bin/fontbakery-check-ttf.py +++ b/bin/fontbakery-check-ttf.py @@ -55,9 +55,11 @@ def fontbakery_check_ttf(config): elif config['verbose'] >= 2: logger.setLevel(logging.DEBUG) else: + fb.progressbar = True logger.setLevel(logging.CRITICAL) if config['error']: + fb.progressbar = False logger.setLevel(logging.ERROR) # ------------------------------------------------------