Commit 23ab5275 authored by Sean Leavey's avatar Sean Leavey

Provide property containing stdout with the Finesse banner stripped out, and use this for the CLI

parent 1988b147
......@@ -136,7 +136,7 @@ def cli(file, simulate, xstart, xstop, xsteps, xscale, noxaxis, trace, powers, m
results = kat.run()
if kat.trace or powers:
click.echo(results.stdout)
click.echo(results.raw_output)
if has_xaxis and (plot or save_figure is not None):
results.plot(show=plot, filename=save_figure)
......
......@@ -640,6 +640,18 @@ class KatRun(object):
if return_fig:
return fig
@property
def raw_output(self):
"""Contents of stdout with the Finesse banner removed."""
# Remove everything above the second occurrance of a line with
# 72 dashes (the bottom of the Finesse banner).
output = self.stdout.split("-" * 72)
if len(output) <= 2:
# No dashes found - return what we have.
return self.stdout
output = "".join(output[2:])
return output
def saveKatRun(self, filename):
with open(filename,'w') as outfile:
pickle.dump(self, outfile)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment