MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / as_posixpath

Function as_posixpath

src/commoncode/fileutils.py:166–173  ·  view source on GitHub ↗

r""" Return a POSIX-like path using POSIX path separators (slash or "/") for a `location` path. This converts Windows paths to look like POSIX paths: Python accepts gracefully POSIX paths on Windows.

(location)

Source from the content-addressed store, hash-verified

164
165
166def as_posixpath(location):
167 r"""
168 Return a POSIX-like path using POSIX path separators (slash or "/") for a
169 `location` path. This converts Windows paths to look like POSIX paths: Python
170 accepts gracefully POSIX paths on Windows.
171 """
172 location = prepare_path(location)
173 return location.replace("\\", "/")
174
175
176def as_winpath(location):

Callers 15

is_datafileMethod · 0.90
_parseFunction · 0.90
get_file_referencesFunction · 0.90
get_templateFunction · 0.90
run_scanFunction · 0.90
to_decoded_posix_pathFunction · 0.90
full_root_pathMethod · 0.90
safe_pathFunction · 0.90
resolveFunction · 0.90
test_fileutils_walkMethod · 0.90

Calls 2

prepare_pathFunction · 0.85
replaceMethod · 0.45