MCPcopy Create free account
hub / github.com/comaps/comaps / file_uri_to_path

Function file_uri_to_path

tools/python/maps_generator/utils/file.py:34–43  ·  view source on GitHub ↗
(url : AnyStr)

Source from the content-addressed store, hash-verified

32 return urlparse(url).scheme == "file"
33
34def file_uri_to_path(url : AnyStr) -> AnyStr:
35 file_uri = urlparse(url)
36 file_path = file_uri.path
37
38 # URI is something like "file://~/..."
39 if file_uri.netloc == '~':
40 file_path = f'~{file_uri.path}'
41 return os.path.expanduser(file_path)
42
43 return file_path
44
45def is_executable(fpath: AnyStr) -> bool:
46 return fpath is not None and os.path.isfile(fpath) and os.access(fpath, os.X_OK)

Callers 1

download_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected