Skip to content

Commit

Permalink
csbuild: flush output written by StatusWriter
Browse files Browse the repository at this point in the history
... to make sure it does not get interleaved with the output
of external commands

Closes #22
  • Loading branch information
kdudka committed Oct 24, 2018
1 parent a47e16e commit 193df2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions py/csbuild
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ class StatusWriter:
def emit_warning(self, msg):
sys.stderr.write("%s: %swarning%s: %s\n" %
(TOOL_NAME, self.color_y, self.color_n, msg))
sys.stderr.flush()

def emit_status(self, msg):
sys.stderr.write("%s: %sstatus%s: %s\n" %
(TOOL_NAME, self.color_g, self.color_n, msg))
sys.stderr.flush()

def print_stats(self, err_file):
os.system("csgrep --mode=stat %s %s \"%s\"" %
Expand All @@ -97,6 +99,7 @@ class StatusWriter:
def print_defect_list(self, err_file, title):
hline = "=" * len(title)
print("\n%s%s\n%s%s" % (self.color_b, title, hline, self.color_n))
sys.stdout.flush()

# pass the --[no-]color option to csgrep
os.system("csgrep %s %s \"%s\"" %
Expand Down

0 comments on commit 193df2e

Please sign in to comment.