From 1e7efbabd3d9d90a0a63b056d26e71331cd7dd3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 22 Mar 2015 22:32:45 +0100 Subject: Add possibility to hide programs output --- conf.py | 4 ++++ scripts/initialize.py | 6 +++++- scripts/solution.py | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index b006d56..49ac413 100644 --- a/conf.py +++ b/conf.py @@ -32,3 +32,7 @@ iteration_file = build_folder + '/iteration' # Programs paths kconfig_parser = checkXf(pf('programs/kconfig_parser'), 'You must build programs first.') + +# Programs output hide +kconfig_parser_output = False +minisat_output = False diff --git a/scripts/initialize.py b/scripts/initialize.py index 2895444..87a98b4 100644 --- a/scripts/initialize.py +++ b/scripts/initialize.py @@ -14,7 +14,11 @@ def kconfig_parser(): env['KERNELVERSION'] = 'KERNELVERSION' # hides error wd = os.getcwd() os.chdir(conf.linux_sources) - subprocess.call([conf.kconfig_parser, conf.linux_kconfig_head, conf.build_folder], env=env) + if conf.kconfig_parser_output: + subprocess.call([conf.kconfig_parser, conf.linux_kconfig_head, conf.build_folder, "-v", "-v"], env=env) + else: + subprocess.call([conf.kconfig_parser, conf.linux_kconfig_head, conf.build_folder], env=env) + os.chdir(wd) def gen_requred(): diff --git a/scripts/solution.py b/scripts/solution.py index 0ad1c4f..0ba4d93 100644 --- a/scripts/solution.py +++ b/scripts/solution.py @@ -5,6 +5,7 @@ import subprocess import utils from conf import conf +from exceptions import NoSolution def generate(): """Collect boolean equations from files: rules, solved and required @@ -53,7 +54,10 @@ def generate(): w_file.close() # Execute minisat - subprocess.call(['minisat', w_file.name, conf.solution_file]) + if conf.minisat_output: + subprocess.call(['minisat', w_file.name, conf.solution_file]) + else: + subprocess.call(['minisat', w_file.name, conf.solution_file], stdout=subprocess.DEVNULL) os.remove(w_file.name) -- cgit v1.2.3