Skip to content

Commit

Permalink
Update types.py
Browse files Browse the repository at this point in the history
  • Loading branch information
95833 committed Dec 22, 2024
1 parent 7caff64 commit 211b968
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugin/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,15 @@ def map_uri_on_payload(self, payload: Any, is_from_client_to_server: bool) -> An

return payload

def map_client_path_to_server_uri(self, path: str) -> str:
return self.map_uri_on_payload(filename_to_uri(path), is_from_client_to_server=True)

def map_server_uri_to_client_path(self, uri: str) -> str:
scheme, path = parse_uri(self.map_uri_on_payload(uri, is_from_client_to_server=False))
if scheme not in ("file", "res"):
raise ValueError(f"{uri}: {scheme} URI scheme is unsupported")
return path

def is_disabled_capability(self, capability_path: str) -> bool:
for value in self.disabled_capabilities.walk(capability_path):
if isinstance(value, bool):
Expand Down

0 comments on commit 211b968

Please sign in to comment.