1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-05 14:22:33 +00:00
trezor-firmware/core/src/trezor/ui/container.py
Martin Milata ac711fb8ee style(core): use more recent type annotation syntax
https://www.python.org/dev/peps/pep-0585/ - Type Hinting Generics In Standard Collections
https://www.python.org/dev/peps/pep-0604/ - Allow writing union types as X | Y
2021-04-01 11:12:30 +02:00

17 lines
436 B
Python

from trezor import ui
class Container(ui.Component):
def __init__(self, *children: ui.Component):
super().__init__()
self.children = children
def dispatch(self, event: int, x: int, y: int) -> None:
for child in self.children:
child.dispatch(event, x, y)
if __debug__:
def read_content(self) -> list[str]:
return sum((c.read_content() for c in self.children), [])