Replace backslashes in paths with forward slashes
(path, direction="forward")
| 137 | |
| 138 | |
| 139 | def slashen(path, direction="forward"): |
| 140 | """Replace backslashes in paths with forward slashes""" |
| 141 | |
| 142 | if direction == "forward": |
| 143 | path = path.replace("\\", "/") |
| 144 | |
| 145 | elif direction == "backwards": |
| 146 | path = path.replace("/", "\\") |
| 147 | |
| 148 | elif direction == "native": |
| 149 | path = path.replace("/", str(native_slash)) |
| 150 | path = path.replace("\\", str(native_slash)) |
| 151 | |
| 152 | return path |
| 153 | |
| 154 | |
| 155 | def remove_last_slash(path): |
no outgoing calls
no test coverage detected