3 '''visualisation tools for make-magic'''
5 def write_dot_from_items(items, outfile):
6 '''generate dot file output for dependencies amongst supplied items
7 writes output to a supplied file already opened for writing.
9 Does not have any idea what a group is and will treat it just like anything else
11 print >> outfile, 'digraph depgraph {'
13 print '\tname = "%s";' % (item.name,)
14 for dep in item.depends:
15 print '\t\t"%s" -> "%s";' % (item.name, dep.name)
19 if __name__ == '__main__':
21 write_dot_from_items([], sys.stdout)