MCPcopy Create free account
hub / github.com/LangGraph-GUI/LangGraph-GUI-backend / get_or_create_workspace

Function get_or_create_workspace

src/FileTransmit.py:21–30  ·  view source on GitHub ↗

Ensures the workspace directory for a given username exists. Creates the directory if it doesn't exist.

(username: str)

Source from the content-addressed store, hash-verified

19
20# Utility function to get or create a user's workspace directory
21def get_or_create_workspace(username: str) -> str:
22 """
23 Ensures the workspace directory for a given username exists.
24 Creates the directory if it doesn't exist.
25 """
26 workspace_path = os.path.join('./workspace/', username)
27 if not os.path.exists(workspace_path):
28 os.makedirs(workspace_path)
29 print(f"Created workspace for {username} at {workspace_path}")
30 return workspace_path
31
32
33@file_router.get('/download/{username}')

Callers 3

download_workspaceFunction · 0.85
upload_fileFunction · 0.85
clean_cacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected