forked from genewildish/Mainline
fix(pipeline): Fix config module reference in pipeline_runner
- Import engine config module as engine_config to avoid name collision - Fix UnboundLocalError when accessing config.MESSAGE_DISPLAY_SECS
This commit is contained in:
@@ -314,14 +314,17 @@ def run_pipeline_mode(preset_name: str = "demo"):
|
|||||||
|
|
||||||
# Add message overlay stage if enabled
|
# Add message overlay stage if enabled
|
||||||
if getattr(preset, "enable_message_overlay", False):
|
if getattr(preset, "enable_message_overlay", False):
|
||||||
|
from engine import config as engine_config
|
||||||
from engine.pipeline.adapters import MessageOverlayConfig
|
from engine.pipeline.adapters import MessageOverlayConfig
|
||||||
|
|
||||||
overlay_config = MessageOverlayConfig(
|
overlay_config = MessageOverlayConfig(
|
||||||
enabled=True,
|
enabled=True,
|
||||||
display_secs=config.MESSAGE_DISPLAY_SECS
|
display_secs=engine_config.MESSAGE_DISPLAY_SECS
|
||||||
if hasattr(config, "MESSAGE_DISPLAY_SECS")
|
if hasattr(engine_config, "MESSAGE_DISPLAY_SECS")
|
||||||
else 30,
|
else 30,
|
||||||
topic_url=config.NTFY_TOPIC if hasattr(config, "NTFY_TOPIC") else None,
|
topic_url=engine_config.NTFY_TOPIC
|
||||||
|
if hasattr(engine_config, "NTFY_TOPIC")
|
||||||
|
else None,
|
||||||
)
|
)
|
||||||
pipeline.add_stage(
|
pipeline.add_stage(
|
||||||
"message_overlay", MessageOverlayStage(config=overlay_config)
|
"message_overlay", MessageOverlayStage(config=overlay_config)
|
||||||
@@ -643,15 +646,16 @@ def run_pipeline_mode(preset_name: str = "demo"):
|
|||||||
|
|
||||||
# Add message overlay stage if enabled
|
# Add message overlay stage if enabled
|
||||||
if getattr(new_preset, "enable_message_overlay", False):
|
if getattr(new_preset, "enable_message_overlay", False):
|
||||||
|
from engine import config as engine_config
|
||||||
from engine.pipeline.adapters import MessageOverlayConfig
|
from engine.pipeline.adapters import MessageOverlayConfig
|
||||||
|
|
||||||
overlay_config = MessageOverlayConfig(
|
overlay_config = MessageOverlayConfig(
|
||||||
enabled=True,
|
enabled=True,
|
||||||
display_secs=config.MESSAGE_DISPLAY_SECS
|
display_secs=engine_config.MESSAGE_DISPLAY_SECS
|
||||||
if hasattr(config, "MESSAGE_DISPLAY_SECS")
|
if hasattr(engine_config, "MESSAGE_DISPLAY_SECS")
|
||||||
else 30,
|
else 30,
|
||||||
topic_url=config.NTFY_TOPIC
|
topic_url=engine_config.NTFY_TOPIC
|
||||||
if hasattr(config, "NTFY_TOPIC")
|
if hasattr(engine_config, "NTFY_TOPIC")
|
||||||
else None,
|
else None,
|
||||||
)
|
)
|
||||||
pipeline.add_stage(
|
pipeline.add_stage(
|
||||||
|
|||||||
Reference in New Issue
Block a user