From 0124ff6822df8e626dec1240dc77a0a64da5a725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 2 May 2015 13:28:08 +0200 Subject: Fixes in scripts and add minisat_args --- scripts/initialize.py | 4 ++-- scripts/solution.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/initialize.py b/scripts/initialize.py index 8fb06df..40d9eb5 100644 --- a/scripts/initialize.py +++ b/scripts/initialize.py @@ -6,7 +6,7 @@ import shutil import utils from conf import conf from conf import sf -from exceptions import MissingFile +import exceptions def parse_kconfig(): "Execute parse_kconfig in linux_sources directory." @@ -24,7 +24,7 @@ def gen_requred(): "Generates required depenpency from .config file in linux source tree." if not os.path.isfile(sf(conf.linux_dot_config)): - raise MissingFile(sf(conf.linux_dot_config), + raise exceptions.MissingFile(sf(conf.linux_dot_config), 'Generate initial configuration. Execute make defconfig in linux folder. Or use make menuconfig and change configuration.') utils.build_symbol_map() # Ensure smap existence diff --git a/scripts/solution.py b/scripts/solution.py index 21f6d88..a09257a 100644 --- a/scripts/solution.py +++ b/scripts/solution.py @@ -36,7 +36,7 @@ def generate(): if ln not in lines: lines.add(ln) if os.path.isfile(sf(conf.required_file)): - for lnn in open((conf.required_file), 'r'): + for lnn in open(sf(conf.required_file), 'r'): ln = lnn.rstrip() if ln not in lines: lines.add(ln) @@ -54,9 +54,11 @@ def generate(): # Execute minisat if conf.minisat_output: - subprocess.call(['minisat', w_file.name, sf(conf.solution_file)]) + subprocess.call(['minisat', w_file.name, sf(conf.solution_file)] + + conf.minisat_args) else: - subprocess.call(['minisat', w_file.name, sf(conf.solution_file)], stdout=subprocess.DEVNULL) + subprocess.call(['minisat', w_file.name, sf(conf.solution_file)] + + conf.minisat_args, stdout=subprocess.DEVNULL) os.remove(w_file.name) @@ -98,6 +100,7 @@ def apply(): f.write( ntx + txt + " ") f.write("\n") + # Load variable count with open(sf(conf.symbol_map_file)) as f: for var_num, l in enumerate(f): pass -- cgit v1.2.3