MCPcopy
hub / github.com/InstaPy/InstaPy / slashen

Function slashen

instapy/file_manager.py:139–152  ·  view source on GitHub ↗

Replace backslashes in paths with forward slashes

(path, direction="forward")

Source from the content-addressed store, hash-verified

137
138
139def 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
155def remove_last_slash(path):

Callers 4

use_workspaceFunction · 0.85
update_workspaceFunction · 0.85
get_home_pathFunction · 0.85
verify_workspace_nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected