blob: bb5ddcc1bf5e8dbae35ecc23e86c89fa7fdfd7e1 [file] [log] [blame]
Jack Jansen11493bc2001-05-22 22:18:21 +00001# bgenall - Generate all bgen-generated modules
2#
3import sys
4import os
5import string
6
7def bgenone(dirname, shortname):
8 os.chdir(dirname)
9 m = __import__(shortname+'scan')
10 try:
11 m.main()
12 except:
13 return 0
14 return 1
15
16def main():
17 success = []
18 failure = []
19 sys.path.insert(0, ':')
20 srcdir = os.path.join(os.path.join(sys.prefix, 'Mac'), 'Modules')
21 contents = os.listdir(srcdir)
22 for name in contents:
23 moduledir = os.path.join(srcdir, name)
24 scanmodule = os.path.join(moduledir, name +'scan.py')
25 if os.path.exists(scanmodule):
26 if bgenone(moduledir, name):
27 success.append(name)
28 else:
29 failure.append(name)
30 print 'Done:', string.join(success, ' ')
31 if failure:
32 print 'Failed:', string.join(failure, ' ')
33 return 0
34 return 1
35
36if __name__ == '__main__':
37 rv = main()
38 sys.exit(not rv)