Ramesh-vani commited on
Commit
186ae69
·
verified ·
1 Parent(s): c096e15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -132,12 +132,12 @@ async def create_file(websocket, key,project_name, path,name,root,targetElementD
132
  "path": path,
133
  "name": name,
134
  "root":root,
135
- "targetElementData":targetElementData
136
  }
137
  websockets.broadcast(connected,json.dumps(event))
138
 
139
 
140
- async def create_folder(websocket, key,project_name, path,name, connected):
141
  folder_path = os.path.join(os.getcwd(), 'projects', key,project_name, path,name)
142
  # Create the folder
143
  os.makedirs(folder_path)
@@ -146,6 +146,8 @@ async def create_folder(websocket, key,project_name, path,name, connected):
146
  "data": folder_path,
147
  "path": path,
148
  "name": name,
 
 
149
  }
150
  websockets.broadcast(connected,json.dumps(event))
151
 
@@ -337,7 +339,7 @@ async def exe(websocket,connected,key):
337
  await websocket.send(json.dumps(event))
338
  elif event["command"]["type"]=="create":
339
  if event["item"]=="folder":
340
- await create_folder(websocket, key,event["project_name"], event["path"],event["name"], connected)
341
  else:
342
  await create_file(websocket, key,event["project_name"], event["path"],event["name"],event['root'],event['targetElementData'],event["rpath"], connected)
343
 
 
132
  "path": path,
133
  "name": name,
134
  "root":root,
135
+ "targetElementData":targetElementData,
136
  }
137
  websockets.broadcast(connected,json.dumps(event))
138
 
139
 
140
+ async def create_folder(websocket, key,project_name, path,name,root,targetElementData,rpath, connected):
141
  folder_path = os.path.join(os.getcwd(), 'projects', key,project_name, path,name)
142
  # Create the folder
143
  os.makedirs(folder_path)
 
146
  "data": folder_path,
147
  "path": path,
148
  "name": name,
149
+ "root":root,
150
+ "targetElementData":targetElementData,
151
  }
152
  websockets.broadcast(connected,json.dumps(event))
153
 
 
339
  await websocket.send(json.dumps(event))
340
  elif event["command"]["type"]=="create":
341
  if event["item"]=="folder":
342
+ await create_folder(websocket, key,event["project_name"], event["path"],event["name"],event['root'],event['targetElementData'],event["rpath"], connected)
343
  else:
344
  await create_file(websocket, key,event["project_name"], event["path"],event["name"],event['root'],event['targetElementData'],event["rpath"], connected)
345