diff --git a/main.py b/main.py index edd4550..c9ced19 100644 --- a/main.py +++ b/main.py @@ -20,6 +20,8 @@ prjs = [] inpDir = "C:/inpfiles/" tmpDir = "C:/tmpfiles/" +lockedPrjs = {} + if not os.path.exists(inpDir): os.mkdir(inpDir) @@ -66,6 +68,20 @@ async def fastapi_copy_project(source: str, target: str): copy_project(source, target) return True +@app.get("/isprojectlocked/") +async def fastapi_is_locked(network: str): + return str in lockedPrjs + +@app.post("/lockproject/") +async def fastapi_lock_project(network: str, id: str): + lockedPrjs[str] = id + return True + +@app.post("/unlockproject/") +async def fastapi_unlock_project(network: str): + del lockedPrjs[str] + return True + # undo/redo @app.post("/undo/") async def fastapi_undo(network: str):