From 2b63ccba96d8651f2ff7d43a5f10f95f2b154268 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 21 Aug 2022 22:12:24 +0100 Subject: Use BotBase from bot-core This includes: - Moving to an async main function to start the bot - Moving all extension loading (barring jishaku) to bot core - Adding dunder init files to all packages, required by bot-core ext loaders --- arthur/extensions.py | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 arthur/extensions.py (limited to 'arthur/extensions.py') 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}" -- cgit v1.2.3