Skip to content

Commit

Permalink
modules: Move under src/modules
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimifr committed Apr 3, 2024
1 parent 43d9528 commit 2d5a80a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Module.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ def load_modules(app: Client) -> list[object]:
loaded_modules: list[object] = []

log.info("Searching for modules")
modules: list[Path] = list(Path("modules").rglob("*.py"))
modules: list[Path] = list(Path(__file__).parent.joinpath("modules").rglob("*.py"))
log.info(f"Found {len(modules)} modules")

for module in modules:
log.info(f"Loading module '{module}'")

mdl = import_module(f"modules.{module.name.removesuffix('.py')}")
mdl = import_module(f"src.modules.{module.name.removesuffix('.py')}")

if not hasattr(mdl, "Module"):
log.error(f"Module '{module}' does not have a Module class, cannot load")
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 2d5a80a

Please sign in to comment.