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_clang_array.py | 11 +++++++---- build_files/cmake/cmake_static_check_cppcheck.py | 11 +++++++---- build_files/cmake/cmake_static_check_smatch.py | 11 +++++++---- build_files/cmake/cmake_static_check_sparse.py | 12 ++++++++---- build_files/cmake/cmake_static_check_splint.py | 12 ++++++++---- 5 files changed, 37 insertions(+), 20 deletions(-) (limited to 'build_files') diff --git a/build_files/cmake/cmake_static_check_clang_array.py b/build_files/cmake/cmake_static_check_clang_array.py index 941407170ff..db4e762932e 100644 --- a/build_files/cmake/cmake_static_check_clang_array.py +++ b/build_files/cmake/cmake_static_check_clang_array.py @@ -27,6 +27,8 @@ import subprocess import sys import os +USE_QUIET = (os.environ.get("QUIET", None) is not None) + CHECKER_IGNORE_PREFIX = [ "extern", "intern/moto", @@ -59,11 +61,12 @@ def main(): process_functions = [] 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 " % percent_str) + sys.stdout.flush() + sys.stdout.write("%s " % percent_str) return subprocess.Popen(cmd) diff --git a/build_files/cmake/cmake_static_check_cppcheck.py b/build_files/cmake/cmake_static_check_cppcheck.py index c458e8ede11..518b94d74a5 100644 --- a/build_files/cmake/cmake_static_check_cppcheck.py +++ b/build_files/cmake/cmake_static_check_cppcheck.py @@ -27,6 +27,8 @@ import subprocess import sys import os +USE_QUIET = (os.environ.get("QUIET", None) is not None) + CHECKER_IGNORE_PREFIX = [ "extern", "intern/moto", @@ -62,11 +64,12 @@ def main(): process_functions = [] 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 " % percent_str) + sys.stdout.flush() + sys.stdout.write("%s " % percent_str) return subprocess.Popen(cmd) diff --git a/build_files/cmake/cmake_static_check_smatch.py b/build_files/cmake/cmake_static_check_smatch.py index 5681d2ae5ed..8f7bd37d4c3 100644 --- a/build_files/cmake/cmake_static_check_smatch.py +++ b/build_files/cmake/cmake_static_check_smatch.py @@ -37,7 +37,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(): source_info = project_source_info.build_info(use_cxx=False, ignore_prefix_list=CHECKER_IGNORE_PREFIX) @@ -55,11 +57,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) 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) diff --git a/build_files/cmake/cmake_static_check_splint.py b/build_files/cmake/cmake_static_check_splint.py index 7be28c01af8..d3f22191021 100644 --- a/build_files/cmake/cmake_static_check_splint.py +++ b/build_files/cmake/cmake_static_check_splint.py @@ -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) -- cgit v1.2.3