style: apply ruff lint fixes and formatting to figment modules
Fixes: unused imports, import sorting, unused variable, overly broad exception type in test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,11 @@ class FigmentEffect(EffectPlugin):
|
||||
},
|
||||
)
|
||||
|
||||
def __init__(self, figment_dir: str | None = None, triggers: list[FigmentTrigger] | None = None):
|
||||
def __init__(
|
||||
self,
|
||||
figment_dir: str | None = None,
|
||||
triggers: list[FigmentTrigger] | None = None,
|
||||
):
|
||||
self.config = EffectConfig(
|
||||
enabled=False,
|
||||
intensity=1.0,
|
||||
@@ -125,7 +129,9 @@ class FigmentEffect(EffectPlugin):
|
||||
self._phase = FigmentPhase.REVEAL
|
||||
self._progress = 0.0
|
||||
|
||||
def get_figment_state(self, frame_number: int, w: int, h: int) -> FigmentState | None:
|
||||
def get_figment_state(
|
||||
self, frame_number: int, w: int, h: int
|
||||
) -> FigmentState | None:
|
||||
"""Tick the state machine and return current state, or None if idle."""
|
||||
if not self.config.enabled:
|
||||
return None
|
||||
@@ -178,9 +184,13 @@ class FigmentEffect(EffectPlugin):
|
||||
def _handle_command(self, cmd: FigmentCommand, w: int, h: int) -> None:
|
||||
if cmd.action == FigmentAction.TRIGGER:
|
||||
self.trigger(w, h)
|
||||
elif cmd.action == FigmentAction.SET_INTENSITY and isinstance(cmd.value, (int, float)):
|
||||
elif cmd.action == FigmentAction.SET_INTENSITY and isinstance(
|
||||
cmd.value, (int, float)
|
||||
):
|
||||
self.config.intensity = float(cmd.value)
|
||||
elif cmd.action == FigmentAction.SET_INTERVAL and isinstance(cmd.value, (int, float)):
|
||||
elif cmd.action == FigmentAction.SET_INTERVAL and isinstance(
|
||||
cmd.value, (int, float)
|
||||
):
|
||||
self.config.params["interval_secs"] = float(cmd.value)
|
||||
elif cmd.action == FigmentAction.SET_COLOR and isinstance(cmd.value, str):
|
||||
if cmd.value in THEME_REGISTRY:
|
||||
|
||||
Reference in New Issue
Block a user