MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / _generate_graphviz

Function _generate_graphviz

code2flow/engine.py:639–655  ·  view source on GitHub ↗

Write the graphviz file :param str output_file: :param str extension: :param str final_img_filename:

(output_file, extension, final_img_filename)

Source from the content-addressed store, hash-verified

637
638
639def _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
658def _generate_final_img(output_file, extension, final_img_filename, num_edges):

Callers 2

test_graphviz_errorFunction · 0.90
_generate_final_imgFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_graphviz_errorFunction · 0.72