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