Return a path module and path separator to use for handling (e.g. split and join) `path` using either POSIX or Windows conventions depending on the `path` content. Force usage of POSIX conventions if `posix` is True.
(path, posix=True)
| 66 | |
| 67 | |
| 68 | def path_handlers(path, posix=True): |
| 69 | """ |
| 70 | Return a path module and path separator to use for handling (e.g. split and |
| 71 | join) `path` using either POSIX or Windows conventions depending on the |
| 72 | `path` content. Force usage of POSIX conventions if `posix` is True. |
| 73 | """ |
| 74 | # determine if we use posix or windows path handling |
| 75 | is_posix = is_posixpath(path) |
| 76 | use_posix = posix or is_posix |
| 77 | pathmod = use_posix and posixpath or ntpath |
| 78 | path_sep = "/" if use_posix else "\\" |
| 79 | return pathmod, path_sep |
| 80 | |
| 81 | |
| 82 | def resolve(path, posix=True): |
no test coverage detected