2 # -*- coding: utf-8 -*-
3 ##############################################################################
5 # OpenERP, Open Source Management Solution
6 # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU Affero General Public License as
10 # published by the Free Software Foundation, either version 3 of the
11 # License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU Affero General Public License for more details.
18 # You should have received a copy of the GNU Affero General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ##############################################################################
23 # TODO handle the case of zip modules
29 if len(sys.argv) == 2 and (sys.argv[1] in ['-h', '--help']):
30 print >>sys.stderr, 'Usage: module_graph.py [module1 module2 module3]\n\tWhen no module is specified, all modules in current directory are used'
33 modules = sys.argv[1:]
35 modules = map(os.path.dirname, glob.glob(os.path.join('*', '__terp__.py')))
43 if os.path.isfile(os.path.join(f,"__terp__.py")):
44 info=eval(file(os.path.join(f,"__terp__.py")).read())
45 if info.get('installable', True):
46 for name in info['depends']:
47 if name not in done+modules:
49 if not os.path.exists(name):
50 print '\t%s [color=red]' % (name,)
51 print '\t%s -> %s;' % (f, name)
54 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: