(path, parent_path)
| 143 | |
| 144 | |
| 145 | def relative_path(path, parent_path): |
| 146 | path = normalize_path(path) |
| 147 | parent_path = normalize_path(parent_path) |
| 148 | |
| 149 | if os_utils.is_win(): |
| 150 | path = path.capitalize() |
| 151 | parent_path = parent_path.capitalize() |
| 152 | |
| 153 | if not path.startswith(parent_path): |
| 154 | raise ValueError(path + ' is not subpath of ' + parent_path) |
| 155 | |
| 156 | relative_path = path[len(parent_path):] |
| 157 | |
| 158 | if relative_path.startswith(os.path.sep): |
| 159 | return relative_path[1:] |
| 160 | |
| 161 | return relative_path |
| 162 | |
| 163 | |
| 164 | def split_all(path): |
nothing calls this directly
no test coverage detected