2026-01-18 20:33:49 -06:00
|
|
|
# Python imports
|
|
|
|
|
|
|
|
|
|
# Lib imports
|
|
|
|
|
|
|
|
|
|
# Application imports
|
|
|
|
|
from libs.dto.base_event import BaseEvent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PluginContextException(Exception):
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PluginContext:
|
|
|
|
|
""" PluginContext """
|
|
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
|
super(PluginContext, self).__init__()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _controller_message(self, event: BaseEvent):
|
|
|
|
|
raise PluginContextException("Plugin Context '_controller_message' must be overridden...")
|
|
|
|
|
|
2026-02-28 19:48:04 -06:00
|
|
|
def request_ui_element(self, element_id: str):
|
|
|
|
|
raise PluginContextException("Plugin Context 'request_ui_element' must be overridden...")
|
2026-01-18 20:33:49 -06:00
|
|
|
|
2026-02-28 19:48:04 -06:00
|
|
|
def emit(self, event: BaseEvent):
|
2026-01-18 20:33:49 -06:00
|
|
|
raise PluginContextException("Plugin Context 'emit' must be overridden...")
|
|
|
|
|
|
2026-02-28 19:48:04 -06:00
|
|
|
def emit_to(self, name: str, event: BaseEvent):
|
|
|
|
|
raise PluginContextException("Plugin Context 'emit_to' must be overridden...")
|
|
|
|
|
|
|
|
|
|
def emit_to_selected(self, names: list[str], event: BaseEvent):
|
|
|
|
|
raise PluginContextException("Plugin Context 'emit_to_selected' must be overridden...")
|
2026-02-26 21:09:00 -06:00
|
|
|
|
|
|
|
|
def register_controller(self, name: str, controller):
|
|
|
|
|
raise PluginContextException("Plugin Context 'register_controller' must be overridden...")
|
|
|
|
|
|