Skip to content
Browse files

Add engine option to graph generation (#476)

  • Loading branch information
aarontp committed Dec 9, 2019
1 parent 598898c commit 37fbc9930f73b4dca12a788ef794714660352414
Showing with 23 additions and 3 deletions.
  1. +23 −3 tools/
@@ -1,4 +1,4 @@
#!/usr/bin/env python -v
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2018 Google Inc.
@@ -54,16 +54,36 @@ def create_graph():
description='Create Turbinia evidence graph.')
'-f', '--format', default='png',
help='The format of the output file you wish to generate. Supported '
'types are here:')
help='The format of the output file you wish to generate. Specify '
'"list" to list out the available output types. More info is here: '
'-e', '--engine', default='dot',
help='The graphviz engine used to generate the graph layout. Specify '
'"list" to list out the available engines.')
parser.add_argument('filename', type=unicode, help='where to save the file')
args = parser.parse_args()

if args.format == 'list':
formats = ' '.join(graphviz.FORMATS)
print('Available format types: {0:s}'.format(formats))

if args.format not in graphviz.FORMATS:
print('Format type {0:s} is not supported'.format(args.format))

if args.engine == 'list':
engines = ' '.join(graphviz.ENGINES)
print('Available graph layout engines: {0:s}'.format(engines))

if args.engine not in graphviz.ENGINES:
print('Layout engine type {0:s} is not supported'.format(args.engine))

graph = create_graph()
graph.engine = args.engine
output_file = args.filename.replace('.png', '')


0 comments on commit 37fbc99

Please sign in to comment.
You can’t perform that action at this time.