1991-08-16 10:28:28 -03:00
|
|
|
# Utility module to import all modules in the path, in the hope
|
|
|
|
# that this will update their ".pyc" files.
|
|
|
|
|
1992-03-31 15:06:54 -04:00
|
|
|
import os
|
1991-08-16 10:28:28 -03:00
|
|
|
import sys
|
|
|
|
|
1992-01-01 15:30:14 -04:00
|
|
|
# Sabotage 'gl' and 'stdwin' to prevent windows popping up...
|
|
|
|
for m in 'gl', 'stdwin', 'fl', 'fm':
|
|
|
|
sys.modules[m] = sys
|
|
|
|
|
1991-08-16 10:28:28 -03: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 15:30:14 -04:00
|
|
|
if tail == '.py' and head not in exceptions:
|
1991-08-16 10:28:28 -03:00
|
|
|
s = 'import ' + head
|
|
|
|
print s
|
|
|
|
try:
|
|
|
|
exec(s + '\n')
|
1992-01-01 15:30:14 -04:00
|
|
|
except KeyboardInterrupt:
|
|
|
|
del names[:]
|
|
|
|
print '\n[interrupt]'
|
|
|
|
break
|
1991-08-16 10:28:28 -03:00
|
|
|
except:
|
1992-01-01 15:30:14 -04:00
|
|
|
print 'Sorry:', sys.exc_type + ':',
|
|
|
|
print sys.exc_value
|