The on-disk path a unit belongs to (the parent file for a slice).
(unit: "Path | FileSlice | str")
| 126 | |
| 127 | |
| 128 | def unit_path(unit: "Path | FileSlice | str") -> Path: |
| 129 | """The on-disk path a unit belongs to (the parent file for a slice).""" |
| 130 | if isinstance(unit, FileSlice): |
| 131 | return unit.path |
| 132 | if isinstance(unit, Path): |
| 133 | return unit |
| 134 | return Path(unit) |
| 135 | |
| 136 | |
| 137 | def is_splittable_text(path: "Path | FileSlice | str") -> bool: |
no outgoing calls