Workspace¶
shared/workspace.py — Centralized path construction for the workspace filesystem.
All services use these helpers to build consistent paths. The root is configured via DIVE_PATH env var (default: /root/DIVE).
Path helpers¶
| Function | Returns |
|---|---|
workspace_path(owner_id, room_id) |
{DIVE_PATH}/{owner_id}/workspaces/{room_id}/ |
metadata_path(owner_id, room_id) |
.../{room_id}/metadata.json |
specs_xml_path(owner_id, room_id) |
.../{room_id}/specifications.xml |
panel_workspace_path(owner_id, room_id, panel_id) |
.../{room_id}/panels/{panel_id}/ |
Metadata operations¶
read_metadata(owner_id, room_id) -> dict
metadata.json from the workspace. Returns empty dict if file doesn't exist.
write_metadata(owner_id, room_id, data) -> None
metadata.json to the workspace.
Symlink operations¶
link_data_file(workspace: Path, filename: str, source: Path) -> None
workspace/data/{filename} pointing to source.
unlink_data_file(workspace: Path, filename: str) -> None