Commit 078f33ac authored by Stanislav Bohm's avatar Stanislav Bohm

ENH: --write-graph option for rview

parent 52e79ea2
......@@ -22,6 +22,9 @@ def parse_args():
parser.add_argument("--show-graph",
action="store_true")
parser.add_argument("--write-graph",
metavar="FILENAME")
parser.add_argument("--show-trace",
action="store_true")
......@@ -43,6 +46,12 @@ def show_graph(report):
run_program(("xdot", "-"), dot)
def write_graph(report, filename):
dot = report.create_graph().make_dot("Plan")
with open(filename, "w") as f:
f.write(dot)
def show_trace(report):
plt.ion()
plt.gca().invert_yaxis()
......@@ -69,12 +78,16 @@ def main():
empty = False
show_graph(report)
if args.write_graph:
empty = False
write_graph(report, args.write_graph)
if args.show_trace:
empty = False
show_trace(report)
if empty:
sys.stderr.write("No operation specified\n")
sys.stderr.write("No operation specified (use --help)\n")
if __name__ == "__main__":
main()
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