forked from genewildish/Mainline
Major changes: - Pipeline architecture with capability-based dependency resolution - Effects plugin system with performance monitoring - Display abstraction with multiple backends (terminal, null, websocket) - Camera system for viewport scrolling - Sensor framework for real-time input - Command-and-control system via ntfy - WebSocket display backend for browser clients - Comprehensive test suite and documentation Issue #48: ADR for preset scripting language included This commit consolidates 110 individual commits into a single feature integration that can be reviewed and tested before further refinement.
39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
from pathlib import Path
|
|
|
|
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 = {}
|
|
|
|
for file_path in PLUGIN_DIR.glob("*.py"):
|
|
if file_path.name.startswith("_"):
|
|
continue
|
|
module_name = file_path.stem
|
|
if module_name in ("base", "types"):
|
|
continue
|
|
|
|
try:
|
|
module = __import__(f"engine.effects.plugins.{module_name}", fromlist=[""])
|
|
for attr_name in dir(module):
|
|
attr = getattr(module, attr_name)
|
|
if (
|
|
isinstance(attr, type)
|
|
and issubclass(attr, EffectPlugin)
|
|
and attr is not EffectPlugin
|
|
and attr_name.endswith("Effect")
|
|
):
|
|
plugin = attr()
|
|
if not isinstance(plugin, EffectPlugin):
|
|
continue
|
|
registry.register(plugin)
|
|
imported[plugin.name] = plugin
|
|
except Exception:
|
|
pass
|
|
|
|
return imported
|