From e84a187ce39c263b7b24454fd0a211d095151b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bi=C3=A1n=20Tam=C3=A1s=20L=C3=A1szl=C3=B3?= Date: Wed, 6 Feb 2013 11:46:04 +0100 Subject: [PATCH] Added flexibility to Minisat class --- satispy/solver/minisat.py | 7 ++++++- setup.py | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/satispy/solver/minisat.py b/satispy/solver/minisat.py index cc6b4ff..5dea2a8 100644 --- a/satispy/solver/minisat.py +++ b/satispy/solver/minisat.py @@ -13,6 +13,11 @@ def __getitem__(self, i): return self.varmap[i] class Minisat(object): + COMMAND = 'minisat %s %s > /dev/null' + + def __init__(self, command=COMMAND): + self.command = command + def solve(self, cnf): s = Solution() @@ -23,7 +28,7 @@ def solve(self, cnf): infile.write(io.tostring(cnf)) infile.flush() - ret = call('minisat %s %s > /dev/null' % (infile.name, outfile.name), shell=True) + ret = call(self.command % (infile.name, outfile.name), shell=True) infile.close() diff --git a/setup.py b/setup.py index 90fbc76..430e453 100755 --- a/setup.py +++ b/setup.py @@ -5,12 +5,12 @@ setup( name='satispy', - version='1.0a1', + version='1.0a2', description='An interface to SAT solver tools (like minisat)', author='FÁBIÁN Tamás László', author_email='giganetom@gmail.com', url='https://github.com/netom/satispy/', - download_url='https://github.com/netom/satispy/tarball/1.0a1#egg=satispy-1.0a1', + download_url='https://github.com/netom/satispy/tarball/1.0a2#egg=satispy-1.0a2', license='BSD License', platforms='OS Independent', packages=['satispy', 'satispy.io', 'satispy.solver'],