forked from genewildish/Mainline
refactor: Make EffectPlugin an abstract base class, update effects to inherit from it, and improve plugin discovery.
This commit is contained in:
@@ -5,6 +5,7 @@ PLUGIN_DIR = Path(__file__).parent
|
||||
|
||||
def discover_plugins():
|
||||
from engine.effects.registry import get_registry
|
||||
from engine.effects.types import EffectPlugin
|
||||
|
||||
registry = get_registry()
|
||||
imported = {}
|
||||
@@ -22,8 +23,8 @@ def discover_plugins():
|
||||
attr = getattr(module, attr_name)
|
||||
if (
|
||||
isinstance(attr, type)
|
||||
and hasattr(attr, "name")
|
||||
and hasattr(attr, "process")
|
||||
and issubclass(attr, EffectPlugin)
|
||||
and attr is not EffectPlugin
|
||||
and attr_name.endswith("Effect")
|
||||
):
|
||||
plugin = attr()
|
||||
|
||||
Reference in New Issue
Block a user