diff options
| author | 2020-09-28 03:37:32 +0100 | |
|---|---|---|
| committer | 2020-09-28 03:37:32 +0100 | |
| commit | aab900877e285aade1bc45966e9b029d5559f04e (patch) | |
| tree | aaaadb8f1f3a080604b15c728a7d17184d203e41 /bot/exts/__init__.py | |
| parent | sync Pipfile and Pipfile.lock (diff) | |
| parent | PR #458 Deps: update Pillow to 7.2 (diff) | |
Merge branch 'master' into minesweeper-contribution
Diffstat (limited to 'bot/exts/__init__.py')
| -rw-r--r-- | bot/exts/__init__.py | 23 | 
1 files changed, 1 insertions, 22 deletions
| diff --git a/bot/exts/__init__.py b/bot/exts/__init__.py index 25deb9af..13f484ac 100644 --- a/bot/exts/__init__.py +++ b/bot/exts/__init__.py @@ -1,9 +1,8 @@  import logging  import pkgutil -from pathlib import Path  from typing import Iterator -__all__ = ("get_package_names", "walk_extensions") +__all__ = ("get_package_names",)  log = logging.getLogger(__name__) @@ -13,23 +12,3 @@ def get_package_names() -> Iterator[str]:      for package in pkgutil.iter_modules(__path__):          if package.ispkg:              yield package.name - - -def walk_extensions() -> Iterator[str]: -    """ -    Iterate dot-separated paths to all extensions. - -    The strings are formatted in a way such that the bot's `load_extension` -    method can take them. Use this to load all available extensions. - -    This intentionally doesn't make use of pkgutil's `walk_packages`, as we only -    want to build paths to extensions - not recursively all modules. For some -    extensions, the `setup` function is in the package's __init__ file, while -    modules nested under the package are only helpers. Constructing the paths -    ourselves serves our purpose better. -    """ -    base_path = Path(__path__[0]) - -    for package in get_package_names(): -        for extension in pkgutil.iter_modules([base_path.joinpath(package)]): -            yield f"bot.exts.{package}.{extension.name}" | 
