From 5ecf68b9c343cb4e0ac10add3f866eda48612d26 Mon Sep 17 00:00:00 2001 From: Simon Olofsson Date: Sun, 7 Jan 2024 22:23:02 +0100 Subject: [PATCH] #89 - enum class for intercept points in plugin API --- pyttman/clients/base.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pyttman/clients/base.py b/pyttman/clients/base.py index de73e09..a8dc986 100644 --- a/pyttman/clients/base.py +++ b/pyttman/clients/base.py @@ -7,10 +7,19 @@ class BaseClient(abc.ABC): Baseclass for Clients, for interfacing with users directly or through an API. """ + class PluginIntercept(enum.StrEnum): + before_intents = "before_intents" + after_intents = "after_intents" + before_app = "before_app" + after_app = "after_app" - def __init__(self, *args, message_router: AbstractMessageRouter, **kwargs): + def __init__(self, + message_router: AbstractMessageRouter, + plugins: list[PyttmanPlugin], + **kwargs): self.message_router = message_router self.name = self.__class__.__name__ + self.plugins = plugins [setattr(self, k, v) for k, v in kwargs.items()]