this also works

pull/35003/head
Cameron Clough 1 week ago
parent e5850df37b
commit c2a2f353f7
  1. 10
      system/ui/lib/wrapper.py

@ -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

Loading…
Cancel
Save