Write the graphviz file :param str output_file: :param str extension: :param str final_img_filename:
(output_file, extension, final_img_filename)
| 637 | |
| 638 | |
| 639 | def _generate_graphviz(output_file, extension, final_img_filename): |
| 640 | """ |
| 641 | Write the graphviz file |
| 642 | :param str output_file: |
| 643 | :param str extension: |
| 644 | :param str final_img_filename: |
| 645 | """ |
| 646 | start_time = time.time() |
| 647 | logging.info("Running graphviz to make the image...") |
| 648 | command = ["dot", "-T" + extension, output_file] |
| 649 | with open(final_img_filename, 'w') as f: |
| 650 | try: |
| 651 | subprocess.run(command, stdout=f, check=True) |
| 652 | logging.info("Graphviz finished in %.2f seconds." % (time.time() - start_time)) |
| 653 | except subprocess.CalledProcessError: |
| 654 | logging.warning("*** Graphviz returned non-zero exit code! " |
| 655 | "Try running %r for more detail ***", ' '.join(command + ['-v', '-O'])) |
| 656 | |
| 657 | |
| 658 | def _generate_final_img(output_file, extension, final_img_filename, num_edges): |
no outgoing calls