From 5cf9d5e4ca28c01420adbceae0e9989651754470 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 7 Nov 2012 01:00:27 +0000 Subject: for utility checkers, use QUIET env var, not to print progress. --- build_files/cmake/cmake_static_check_sparse.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'build_files/cmake/cmake_static_check_sparse.py') diff --git a/build_files/cmake/cmake_static_check_sparse.py b/build_files/cmake/cmake_static_check_sparse.py index 4f4eb838dd5..92d590e52ac 100644 --- a/build_files/cmake/cmake_static_check_sparse.py +++ b/build_files/cmake/cmake_static_check_sparse.py @@ -35,6 +35,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(): @@ -53,11 +56,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.flush() - sys.stdout.write("%s %s\n" % (percent_str, c)) + sys.stdout.flush() + sys.stdout.write("%s %s\n" % (percent_str, c)) return subprocess.Popen(cmd) -- cgit v1.2.3