Add method lockproject, unlockproject, isprojectlocked
This commit is contained in:
16
main.py
16
main.py
@@ -20,6 +20,8 @@ prjs = []
|
|||||||
inpDir = "C:/inpfiles/"
|
inpDir = "C:/inpfiles/"
|
||||||
tmpDir = "C:/tmpfiles/"
|
tmpDir = "C:/tmpfiles/"
|
||||||
|
|
||||||
|
lockedPrjs = {}
|
||||||
|
|
||||||
if not os.path.exists(inpDir):
|
if not os.path.exists(inpDir):
|
||||||
os.mkdir(inpDir)
|
os.mkdir(inpDir)
|
||||||
|
|
||||||
@@ -66,6 +68,20 @@ async def fastapi_copy_project(source: str, target: str):
|
|||||||
copy_project(source, target)
|
copy_project(source, target)
|
||||||
return True
|
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
|
# undo/redo
|
||||||
@app.post("/undo/")
|
@app.post("/undo/")
|
||||||
async def fastapi_undo(network: str):
|
async def fastapi_undo(network: str):
|
||||||
|
|||||||
Reference in New Issue
Block a user