add vcs-* fields to debian/control
[debian/make-magic.git] / lib / vis.py
1 #! /usr/bin/env python 
2
3 '''visualisation tools for make-magic'''
4
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.
8
9         Does not have any idea what a group is and will treat it just like anything else
10         '''
11         print >> outfile, 'digraph depgraph {'
12         for item in items:
13                 print '\tname = "%s";' % (item.name,)
14                 for dep in item.depends:
15                         print '\t\t"%s" -> "%s";' % (item.name, dep.name)
16         print >> outfile, '}'
17
18
19 if __name__ == '__main__':
20         import sys
21         write_dot_from_items([], sys.stdout)