diff options
| author | 2022-08-21 23:04:15 +0100 | |
|---|---|---|
| committer | 2022-08-21 23:04:15 +0100 | |
| commit | dde3773ecb76775edc50e2d13937e07f0970c1d9 (patch) | |
| tree | f0f3426ff0cbc3f00a47f0761f1173512a51312e /arthur/extensions.py | |
| parent | Add missing space to prefix list (diff) | |
| parent | Create dependabot.yml (diff) | |
Merge pull request #15 from python-discord/bot-core-integration
Diffstat (limited to 'arthur/extensions.py')
| -rw-r--r-- | arthur/extensions.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/arthur/extensions.py b/arthur/extensions.py deleted file mode 100644 index 2170d68..0000000 --- a/arthur/extensions.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Utilities for working with extensions.""" -from pathlib import Path -from typing import Generator - - -def find_extensions() -> Generator[tuple[Path, str], None, None]: - """Search the exts directory to find cogs to load.""" - for path in Path("arthur/exts").rglob("**/*.py"): - # Convert a path like "arthur/exts/foo/bar.py" to "arthur.exts.foo.bar" - yield path, path_to_module(path) - - -def path_to_module(path: Path) -> str: - """Convert a path like "arthur/exts/foo/bar.py" to "arthur.exts.foo.bar".""" - return str(path.parent.as_posix()).replace("/", ".") + f".{path.stem}" |