1994-08-29 12:52:58 +02:00
|
|
|
# THIS IS OBSOLETE -- USE MODULE 'compileall' INSTEAD!
|
|
|
|
|
1991-08-16 15:28:28 +02:00
|
|
|
# Utility module to import all modules in the path, in the hope
|
|
|
|
# that this will update their ".pyc" files.
|
|
|
|
|
1992-03-31 21:06:54 +02:00
|
|
|
import os
|
1991-08-16 15:28:28 +02:00
|
|
|
import sys
|
|
|
|
|
1992-01-01 20:30:14 +01:00
|
|
|
# Sabotage 'gl' and 'stdwin' to prevent windows popping up...
|
|
|
|
for m in 'gl', 'stdwin', 'fl', 'fm':
|
|
|
|
sys.modules[m] = sys
|
|
|
|
|
1991-08-16 15:28:28 +02:00
|
|
|
exceptions = ['importall']
|
|
|
|
|
|
|
|
for dir in sys.path:
|
|
|
|
print 'Listing', dir
|
|
|
|
try:
|
|
|
|
names = os.listdir(dir)
|
|
|
|
except os.error:
|
|
|
|
print 'Can\'t list', dir
|
|
|
|
names = []
|
|
|
|
names.sort()
|
|
|
|
for name in names:
|
|
|
|
head, tail = name[:-3], name[-3:]
|
1992-01-01 20:30:14 +01:00
|
|
|
if tail == '.py' and head not in exceptions:
|
1991-08-16 15:28:28 +02:00
|
|
|
s = 'import ' + head
|
|
|
|
print s
|
|
|
|
try:
|
|
|
|
exec(s + '\n')
|
1992-01-01 20:30:14 +01:00
|
|
|
except KeyboardInterrupt:
|
|
|
|
del names[:]
|
|
|
|
print '\n[interrupt]'
|
|
|
|
break
|
1991-08-16 15:28:28 +02:00
|
|
|
except:
|
1992-01-01 20:30:14 +01:00
|
|
|
print 'Sorry:', sys.exc_type + ':',
|
|
|
|
print sys.exc_value
|