summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-05-22 22:18:21 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-05-22 22:18:21 (GMT)
commit11493bc65ffc24f3c32f54e3a145e2ff69cd2ccb (patch)
treeff81a7e94e647cee2997c2ae39b69eb113d04b66
parent98cfab65234d3a8d1708f9c021d17db1c8a661bb (diff)
downloadcpython-11493bc65ffc24f3c32f54e3a145e2ff69cd2ccb.zip
cpython-11493bc65ffc24f3c32f54e3a145e2ff69cd2ccb.tar.gz
cpython-11493bc65ffc24f3c32f54e3a145e2ff69cd2ccb.tar.bz2
Simple script to regenerate all bgen-generated modules.
-rw-r--r--Mac/scripts/bgenall.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/Mac/scripts/bgenall.py b/Mac/scripts/bgenall.py
new file mode 100644
index 0000000..bb5ddcc
--- /dev/null
+++ b/Mac/scripts/bgenall.py
@@ -0,0 +1,38 @@
+# bgenall - Generate all bgen-generated modules
+#
+import sys
+import os
+import string
+
+def bgenone(dirname, shortname):
+ os.chdir(dirname)
+ m = __import__(shortname+'scan')
+ try:
+ m.main()
+ except:
+ return 0
+ return 1
+
+def main():
+ success = []
+ failure = []
+ sys.path.insert(0, ':')
+ srcdir = os.path.join(os.path.join(sys.prefix, 'Mac'), 'Modules')
+ 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) \ No newline at end of file