/
githubmirror
/
bash-completion
Обзор
Документация
Войти
/
githubmirror
/
bash-completion
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.8
helpers/python
14 строк
317 B
Ville Skyttä
python: Support completing dotted module hierarchies
17 дек 2017, 17:07
17 дек 2017, 17:07
db9f81b
Код
Авторство
О чём код?
# -*- 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])