def dependencies_graph(filename, dep_info):
 done = {}
 printer = DotBackend(filename[:(-4)], rankdir='LR')
 printer.emit('URL="." node[shape="box"]')
 for (modname, dependencies) in sorted(six.iteritems(dep_info)):
  done[modname] = 1
  printer.emit_node(modname)
  for modname in dependencies:
   if (modname not in done):
    done[modname] = 1
    printer.emit_node(modname)
 for (depmodname, dependencies) in sorted(six.iteritems(dep_info)):
  for modname in dependencies:
   printer.emit_edge(modname, depmodname)
 printer.generate(filename)

def dependencies_graph ( filename , dep_info ) : done = { } printer = DotBackend ( filename [ : ( - 4 ) ] , rankdir = 'LR' ) printer . emit ( 'URL="." node[shape="box"]' ) for ( modname , dependencies ) in sorted ( six . iteritems ( dep_info ) ) : done [ modname ] = 1 printer . emit_node ( modname ) for modname in dependencies : if ( modname not in done ) : done [ modname ] = 1 printer . emit_node ( modname ) for ( depmodname , dependencies ) in sorted ( six . iteritems ( dep_info ) ) : for modname in dependencies : printer . emit_edge ( modname , depmodname ) printer . generate ( filename )
write dependencies as a dot file .