Iterate over all the parts of a path. Splits path recursively with os.path.split().
(path)
| 631 | |
| 632 | |
| 633 | def _iexplode_path(path): |
| 634 | """Iterate over all the parts of a path. |
| 635 | |
| 636 | Splits path recursively with os.path.split(). |
| 637 | """ |
| 638 | (head, tail) = os.path.split(path) |
| 639 | if not head or (not tail and head == path): |
| 640 | if head: |
| 641 | yield head |
| 642 | if tail or not head: |
| 643 | yield tail |
| 644 | return |
| 645 | for p in _iexplode_path(head): |
| 646 | yield p |
| 647 | yield tail |
| 648 | |
| 649 | |
| 650 | def _translate_glob(pat): |