(path)
| 258 | ) |
| 259 | |
| 260 | def components(path): |
| 261 | # type: (Text) -> Iterable[Text] |
| 262 | |
| 263 | pieces = deque() # type: Deque[Text] |
| 264 | |
| 265 | def append(piece): |
| 266 | if piece and piece != ".": |
| 267 | pieces.appendleft(piece) |
| 268 | |
| 269 | head, tail = os.path.split(path) |
| 270 | append(tail) |
| 271 | while head: |
| 272 | if "/" == head: |
| 273 | append(head) |
| 274 | break |
| 275 | head, tail = os.path.split(head) |
| 276 | append(tail) |
| 277 | return pieces |
| 278 | |
| 279 | prefix = [] # type: List[Text] |
| 280 | for atoms in zip(*(components(path) for path in paths)): |