aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/__init__.py
blob: cb9c5ae813ffd238321738d5c12b9bf854b05796 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import logging
import pkgutil
from collections.abc import Iterator

__all__ = ("get_package_names",)

log = logging.getLogger(__name__)


def get_package_names() -> Iterator[str]:
    """Iterate names of all packages located in /bot/exts/."""
    for package in pkgutil.iter_modules(__path__):
        if package.ispkg:
            yield package.name