|
|
@ -1,19 +1,13 @@ |
|
|
|
import threading |
|
|
|
import threading |
|
|
|
import time |
|
|
|
import time |
|
|
|
from abc import ABC, abstractmethod |
|
|
|
|
|
|
|
from typing import Generic, TypeVar |
|
|
|
from typing import Generic, TypeVar |
|
|
|
from openpilot.system.ui.lib.application import gui_app |
|
|
|
from openpilot.system.ui.lib.application import gui_app |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Renderer: |
|
|
|
class Renderer(ABC): |
|
|
|
def render(self): ... |
|
|
|
@abstractmethod |
|
|
|
|
|
|
|
def render(self) -> None: |
|
|
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
T = TypeVar("T", bound=Renderer) |
|
|
|
T = TypeVar("T", bound=Renderer) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Wrapper(Generic[T]): |
|
|
|
class Wrapper(Generic[T]): |
|
|
|
def __init__(self, title: str, renderer_cls: type[T], *args): |
|
|
|
def __init__(self, title: str, renderer_cls: type[T], *args): |
|
|
|
self._title = title |
|
|
|
self._title = title |
|
|
|