1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-04 05:42:34 +00:00
trezor-firmware/core/src/trezor/ui/components/common/__init__.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

16 lines
381 B
Python

"""
The components/common module contains code that is used by both components/tt
and components/t1.
"""
def break_path_to_lines(path_str: str, per_line: int) -> list[str]:
lines = []
while len(path_str) > per_line:
i = path_str[:per_line].rfind("/")
lines.append(path_str[:i])
path_str = path_str[i:]
lines.append(path_str)
return lines