3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-23 13:18:00 +00:00

Add smtbmc --progress option

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-03-07 22:16:24 +01:00
parent 4d4a9b2e4f
commit 47729cd61c
3 changed files with 16 additions and 5 deletions

View file

@ -23,7 +23,7 @@ from select import select
from time import time
class SbyTask:
def __init__(self, job, info, deps, cmdline, logfile=None):
def __init__(self, job, info, deps, cmdline, logfile=None, logstderr=True):
self.running = False
self.finished = False
self.terminated = False
@ -36,6 +36,7 @@ class SbyTask:
self.noprintregex = None
self.notify = []
self.linebuffer = ""
self.logstderr = logstderr
for dep in self.deps:
dep.register_dep(self)
@ -88,7 +89,8 @@ class SbyTask:
return
self.job.log("%s: starting process \"%s\"" % (self.info, self.cmdline))
self.p = subprocess.Popen(self.cmdline, shell=True, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
self.p = subprocess.Popen(self.cmdline, shell=True, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE,
stderr=(subprocess.STDOUT if self.logstderr else None))
fl = fcntl.fcntl(self.p.stdout, fcntl.F_GETFL)
fcntl.fcntl(self.p.stdout, fcntl.F_SETFL, fl | os.O_NONBLOCK)
self.job.tasks_running.append(self)