Return a list of the path components in loc. (Used by relpath_). The first item in the list will be either ``os.curdir``, ``os.pardir``, empty, or the root directory of loc (for example, ``/`` or ``C:\\). The other items in the list will be strings. Adapted from *path.py* by
(loc)
| 27 | import re |
| 28 | |
| 29 | def splitall(loc): |
| 30 | """ |
| 31 | Return a list of the path components in loc. (Used by relpath_). |
| 32 | |
| 33 | The first item in the list will be either ``os.curdir``, ``os.pardir``, empty, |
| 34 | or the root directory of loc (for example, ``/`` or ``C:\\). |
| 35 | |
| 36 | The other items in the list will be strings. |
| 37 | |
| 38 | Adapted from *path.py* by Jason Orendorff. |
| 39 | """ |
| 40 | parts = [] |
| 41 | while loc != os.curdir and loc != os.pardir: |
| 42 | prev = loc |
| 43 | loc, child = os.path.split(prev) |
| 44 | if loc == prev: |
| 45 | break |
| 46 | parts.append(child) |
| 47 | parts.append(loc) |
| 48 | parts.reverse() |
| 49 | return parts |
| 50 | |
| 51 | def _make_path_relative(origin, dest): |
| 52 | """ |
no outgoing calls
no test coverage detected