for utility checkers, use QUIET env var, not to print progress.

This commit is contained in:
Campbell Barton
2012-11-07 01:00:27 +00:00
parent 0890c2a4a0
commit 5cf9d5e4ca
5 changed files with 37 additions and 20 deletions

View File

@@ -68,6 +68,9 @@ CHECKER_ARGS = [
import project_source_info
import subprocess
import sys
import os
USE_QUIET = (os.environ.get("QUIET", None) is not None)
def main():
@@ -85,11 +88,12 @@ def main():
check_commands.append((c, cmd))
def my_process(i, c, cmd):
percent = 100.0 * (i / (len(check_commands) - 1))
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
if not USE_QUIET:
percent = 100.0 * (i / (len(check_commands) - 1))
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
sys.stdout.write("%s %s\n" % (percent_str, c))
sys.stdout.flush()
sys.stdout.write("%s %s\n" % (percent_str, c))
sys.stdout.flush()
return subprocess.Popen(cmd)