2001-05-22 22:18:21 +00:00
|
|
|
# bgenall - Generate all bgen-generated modules
|
|
|
|
#
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import string
|
|
|
|
|
|
|
|
def bgenone(dirname, shortname):
|
|
|
|
os.chdir(dirname)
|
2002-08-05 21:14:16 +00:00
|
|
|
print '%s:'%shortname
|
|
|
|
# Sigh, we don't want to lose CVS history, so two
|
|
|
|
# modules have funny names:
|
|
|
|
if shortname == 'carbonevt':
|
|
|
|
modulename = 'CarbonEvtscan'
|
|
|
|
elif shortname == 'ibcarbon':
|
|
|
|
modulename = 'IBCarbonscan'
|
|
|
|
else:
|
|
|
|
modulename = shortname + 'scan'
|
2001-12-14 23:01:34 +00:00
|
|
|
try:
|
2002-08-05 21:14:16 +00:00
|
|
|
m = __import__(modulename)
|
2001-12-14 23:01:34 +00:00
|
|
|
except:
|
2002-08-05 21:14:16 +00:00
|
|
|
print "Error:", shortname, sys.exc_info()[1]
|
2001-12-14 23:01:34 +00:00
|
|
|
return 0
|
2001-05-22 22:18:21 +00:00
|
|
|
try:
|
|
|
|
m.main()
|
|
|
|
except:
|
2002-08-05 21:14:16 +00:00
|
|
|
print "Error:", shortname, sys.exc_info()[1]
|
2001-05-22 22:18:21 +00:00
|
|
|
return 0
|
|
|
|
return 1
|
|
|
|
|
|
|
|
def main():
|
|
|
|
success = []
|
|
|
|
failure = []
|
2002-08-05 15:33:44 +00:00
|
|
|
sys.path.insert(0, os.curdir)
|
|
|
|
if len(sys.argv) > 1:
|
|
|
|
srcdir = sys.argv[1]
|
|
|
|
else:
|
|
|
|
srcdir = os.path.join(os.path.join(sys.prefix, 'Mac'), 'Modules')
|
|
|
|
srcdir = os.path.abspath(srcdir)
|
2001-05-22 22:18:21 +00:00
|
|
|
contents = os.listdir(srcdir)
|
|
|
|
for name in contents:
|
|
|
|
moduledir = os.path.join(srcdir, name)
|
|
|
|
scanmodule = os.path.join(moduledir, name +'scan.py')
|
|
|
|
if os.path.exists(scanmodule):
|
|
|
|
if bgenone(moduledir, name):
|
|
|
|
success.append(name)
|
|
|
|
else:
|
|
|
|
failure.append(name)
|
|
|
|
print 'Done:', string.join(success, ' ')
|
|
|
|
if failure:
|
|
|
|
print 'Failed:', string.join(failure, ' ')
|
|
|
|
return 0
|
|
|
|
return 1
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
rv = main()
|
|
|
|
sys.exit(not rv)
|