MCPcopy
hub / github.com/dataelement/Clawith / _normalize_workspace_path

Function _normalize_workspace_path

backend/app/services/workspace_locking.py:21–32  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

19
20
21def _normalize_workspace_path(path: str) -> str:
22 clean = (path or "").replace("\\", "/").strip().lstrip("/")
23 parts: list[str] = []
24 for part in clean.split("/"):
25 if part in ("", "."):
26 continue
27 if part == "..":
28 if parts:
29 parts.pop()
30 continue
31 parts.append(part)
32 return "/".join(parts)
33
34
35def _lock_key(agent_id: uuid.UUID, path: str) -> str:

Callers 2

_lock_keyFunction · 0.85
workspace_locksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected