Skip to content

Commit

Permalink
Merge pull request #1360 from felipesanches/bring_back_progressbar
Browse files Browse the repository at this point in the history
revert 90c9dee
  • Loading branch information
felipesanches authored May 20, 2017
2 parents 53c8490 + 7cd7962 commit 84123e9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Lib/fontbakery/fbchecklogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
NORMAL
)
class FontBakeryCheckLogger():
progressbar = False

def __init__(self, config):
self.config = config
Expand Down Expand Up @@ -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":
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions bin/fontbakery-check-ttf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

# ------------------------------------------------------
Expand Down

0 comments on commit 84123e9

Please sign in to comment.