Skip to content

Commit

Permalink
Refs #11054 Accept dot binary as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Jeffery committed Feb 11, 2015
1 parent 6f1fba6 commit 4553d74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Code/Mantid/docs/generate_diagrams.py
Expand Up @@ -27,11 +27,13 @@

parser = argparse.ArgumentParser(description="Generate diagrams from dot files")

parser.add_argument("-x", "--dot-executable", default="/usr/bin/dot", help="The path to graphviz's dot tool")
parser.add_argument("output_dir", help="The directory to write the output files to")
parser.add_argument("input_files", nargs="+", help="The .dot files to process")

args = parser.parse_args()

print("dot executable: " + args.dot_executable)
print("Output dir: " + args.output_dir)

if not os.path.exists(args.output_dir):
Expand All @@ -49,7 +51,7 @@
out_src = string.Template(in_src).substitute(STYLE)

print("Writing: " + png_path)
gviz = subprocess.Popen(["dot","-Tpng","-o",png_path], stdin=subprocess.PIPE)
gviz = subprocess.Popen([args.dot_executable,"-Tpng","-o",png_path], stdin=subprocess.PIPE)
gviz.communicate(input=out_src)
gviz.wait()

0 comments on commit 4553d74

Please sign in to comment.