Return a root-first list of all ancestor directories plus the path itself.
(self, reverse=False)
| 487 | return self.check(file=1) |
| 488 | |
| 489 | def parts(self, reverse=False): |
| 490 | """Return a root-first list of all ancestor directories |
| 491 | plus the path itself. |
| 492 | """ |
| 493 | current = self |
| 494 | lst = [self] |
| 495 | while 1: |
| 496 | last = current |
| 497 | current = current.dirpath() |
| 498 | if last == current: |
| 499 | break |
| 500 | lst.append(current) |
| 501 | if not reverse: |
| 502 | lst.reverse() |
| 503 | return lst |
| 504 | |
| 505 | def common(self, other): |
| 506 | """Return the common part shared with the other path |