mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-04 05:42:34 +00:00

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
16 lines
381 B
Python
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
|