Skip to content

Commit

Permalink
Merge pull request #107 from fernandodpr/main
Browse files Browse the repository at this point in the history
feat: Extend plugin configuration loader to support dynamic levels
  • Loading branch information
jeremiah-k authored Nov 28, 2024
2 parents 8d98d42 + 025d688 commit 952186b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/base_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ def __init__(self) -> None:
super().__init__()
self.logger = get_logger(f"Plugin:{self.plugin_name}")
self.config = {"active": False}
if "plugins" in relay_config and self.plugin_name in relay_config["plugins"]:
self.config = relay_config["plugins"][self.plugin_name]
plugin_levels = ["plugins", "community-plugins", "custom-plugins"]

for level in plugin_levels:
if level in relay_config and self.plugin_name in relay_config[level]:
self.config = relay_config[level][self.plugin_name]
break

def start(self):
if "schedule" not in self.config or (
Expand Down

0 comments on commit 952186b

Please sign in to comment.