blob: b6c4d5ed5938516351aac3cbbf3ca98e6c1de022 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
# -*- python -*-
import pkgutil
import sys
# walk_packages() is much slower than iter_modules(), use it only when
# completing something with a dot in it.
if len(sys.argv) > 1 and "." in sys.argv[1]:
walker = pkgutil.walk_packages
else:
walker = pkgutil.iter_modules
for mod in walker():
print(mod[1])
|