diff options
author | Karel Kočí <cynerd@email.cz> | 2015-05-14 10:50:34 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-05-14 10:50:34 +0200 |
commit | 71ffeac967944bfd4f61d1f5724c8aed9d6d35a3 (patch) | |
tree | 6e57b85646280a6cebe016298bf97a618e867881 /scripts/solution.py | |
parent | 47e9eade57344dbb249b7cee3fa7afeaeb7f322f (diff) | |
download | linux-conf-perf-71ffeac967944bfd4f61d1f5724c8aed9d6d35a3.tar.gz linux-conf-perf-71ffeac967944bfd4f61d1f5724c8aed9d6d35a3.tar.bz2 linux-conf-perf-71ffeac967944bfd4f61d1f5724c8aed9d6d35a3.zip |
Fix problems with configurations genration
Diffstat (limited to 'scripts/solution.py')
-rw-r--r-- | scripts/solution.py | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/scripts/solution.py b/scripts/solution.py index 1ee1664..61cf65c 100644 --- a/scripts/solution.py +++ b/scripts/solution.py @@ -70,22 +70,21 @@ def generate(): if conf.picosat_output: print(line, end="") if line[0] == 's': - if line.rstrip() == 's SATISFIABLE': - try: - solut.remove(0) - with open(sf(conf.config_map_file), 'a') as fm: - fm.write(str(utils.hash_config(solut)) + ':') - for sl in solut: - fm.write(str(sl) + ' ') - fm.write('\n') - with open(sf(conf.solved_file), 'a') as fs: - for sl in solut: - fs.write(str(-1 * sl) + ' ') - fs.write('\n') - except ValueError: - pass - solut = [] - else: + try: + solut.remove(0) + with open(sf(conf.config_map_file), 'a') as fm: + fm.write(str(utils.hash_config(solut)) + ':') + for sl in solut: + fm.write(str(sl) + ' ') + fm.write('\n') + with open(sf(conf.solved_file), 'a') as fs: + for sl in solut: + fs.write(str(-1 * sl) + ' ') + fs.write('\n') + except ValueError: + pass + solut = [] + if not line.rstrip() == 's SATISFIABLE': os.remove(w_file.name) raise exceptions.NoSolution() elif line[0] == 'v': |