3 moduledir = '@MODULEDIR@'
6 from os.path import dirname, realpath
8 if moduledir.startswith('@'):
9 moduledir = dirname(dirname(realpath(sys.argv[0])))
11 sys.path.insert(0, moduledir)
13 from matrix import graph
16 ("components", graph.ComponentGraph, "Create a components file from the dependancy tree"),
17 ("dot", graph.DotGraph, "Create a graph from the dependancy tree with 'dot'"),
20 print "\nCopyright (C) 2007-2008 Movial Oy\n"
23 print "Please specify one of the following commands:\n"
24 for command, obj, description in commands:
25 print " %-15s %s" % (command, description)
29 if sys.argv[1] == "components":
30 g = graph.ComponentGraph(sys.argv[2:])
31 elif sys.argv[1] == "dot":
32 g = graph.DotGraph(sys.argv[2:])
34 print "Unknown command", sys.argv[1]