attempt to add plugin events to the plugin frontend api.

unable to test right now though
This commit is contained in:
Party Wumpus
2024-04-09 15:44:38 +01:00
committed by PartyWumpus
parent de9d2144a6
commit f9ff518e6d
6 changed files with 57 additions and 21 deletions
+2 -3
View File
@@ -19,7 +19,7 @@ import subprocess
import logging
import time
from typing import TypeVar, Type
from typing import Any
"""
Constants
@@ -213,9 +213,8 @@ logger.setLevel(logging.INFO)
"""
Event handling
"""
DataType = TypeVar("DataType")
# TODO better docstring im lazy
async def emit(event: str, data: DataType | None = None, data_type: Type[DataType] | None = None) -> None:
async def emit(event: str, *args: Any) -> None:
"""
Send an event to the frontend.
"""
@@ -16,7 +16,7 @@ __version__ = '0.1.0'
import logging
from typing import TypeVar, Type
from typing import Any
"""
Constants
@@ -177,9 +177,8 @@ logger: logging.Logger
"""
Event handling
"""
DataType = TypeVar("DataType")
# TODO better docstring im lazy
async def emit(event: str, data: DataType | None = None, data_type: Type[DataType] | None = None) -> None:
async def emit(event: str, *args: Any) -> None:
"""
Send an event to the frontend.
"""