This commit implements the Sideline/Mainline split with a clean plugin architecture: ## Core Changes ### Sideline Framework (New Directory) - Created directory containing the reusable pipeline framework - Moved pipeline core, controllers, adapters, and registry to - Moved display system to - Moved effects system to - Created plugin system with security and compatibility management in - Created preset pack system with ASCII art encoding in - Added default font (Corptic) to - Added terminal ANSI constants to ### Mainline Application (Updated) - Created for Mainline stage component registration - Updated to register Mainline stages at startup - Updated as a compatibility shim re-exporting from sideline ### Terminology Consistency - : Base class for all pipeline components (sources, effects, displays, cameras) - : Base class for distributable plugin packages (was ) - : Base class for visual effects (was ) - Backward compatibility aliases maintained for existing code ## Key Features - Plugin discovery via entry points and explicit registration - Security permissions system for plugins - Compatibility management with semantic version constraints - Preset pack system for distributable configurations - Default font bundled with Sideline (Corptic.otf) ## Testing - Updated tests to register Mainline stages before discovery - All StageRegistry tests passing Note: This is a major refactoring that separates the framework (Sideline) from the application (Mainline), enabling Sideline to be used by other applications.
39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
"""Factory functions for creating stage instances."""
|
|
|
|
from sideline.pipeline.adapters.camera import CameraStage
|
|
from sideline.pipeline.adapters.data_source import DataSourceStage
|
|
from sideline.pipeline.adapters.display import DisplayStage
|
|
from sideline.pipeline.adapters.effect_plugin import EffectPluginStage
|
|
from sideline.pipeline.adapters.transform import FontStage
|
|
|
|
|
|
def create_stage_from_display(display, name: str = "terminal") -> DisplayStage:
|
|
"""Create a DisplayStage from a display instance."""
|
|
return DisplayStage(display, name=name)
|
|
|
|
|
|
def create_stage_from_effect(effect_plugin, name: str) -> EffectPluginStage:
|
|
"""Create an EffectPluginStage from an effect plugin."""
|
|
return EffectPluginStage(effect_plugin, name=name)
|
|
|
|
|
|
def create_stage_from_source(data_source, name: str = "headlines") -> DataSourceStage:
|
|
"""Create a DataSourceStage from a data source."""
|
|
return DataSourceStage(data_source, name=name)
|
|
|
|
|
|
def create_stage_from_camera(camera, name: str = "vertical") -> CameraStage:
|
|
"""Create a CameraStage from a camera instance."""
|
|
return CameraStage(camera, name=name)
|
|
|
|
|
|
def create_stage_from_font(
|
|
font_path: str | None = None,
|
|
font_size: int | None = None,
|
|
font_ref: str | None = "default",
|
|
name: str = "font",
|
|
) -> FontStage:
|
|
"""Create a FontStage with specified font configuration."""
|
|
# FontStage currently doesn't use these parameters but keeps them for compatibility
|
|
return FontStage(name=name)
|