Ramesh-vani commited on
Commit
f3a677c
·
verified ·
1 Parent(s): 289707d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -121,7 +121,7 @@ async def get_file_content(websocket, key,project_name, path,rpath,name,connecte
121
 
122
 
123
 
124
- async def create_file(websocket, key,project_name, path,name, connected):
125
  file_path = os.path.join(os.getcwd(), 'projects', key,project_name, path,name)
126
  # Create the file
127
  with open(file_path, 'w'):
@@ -131,6 +131,8 @@ async def create_file(websocket, key,project_name, path,name, connected):
131
  "data": file_path,
132
  "path": path,
133
  "name": name,
 
 
134
  }
135
  websockets.broadcast(connected,json.dumps(event))
136
 
@@ -337,7 +339,7 @@ async def exe(websocket,connected,key):
337
  if event["item"]=="folder":
338
  await create_folder(websocket, key,event["project_name"], event["path"],event["name"], connected)
339
  else:
340
- await create_file(websocket, key,event["project_name"], event["path"],event["name"], connected)
341
 
342
 
343
  elif event["command"]["type"]=="delete":
 
121
 
122
 
123
 
124
+ async def create_file(websocket, key,project_name, path,name,root,targetElement, connected):
125
  file_path = os.path.join(os.getcwd(), 'projects', key,project_name, path,name)
126
  # Create the file
127
  with open(file_path, 'w'):
 
131
  "data": file_path,
132
  "path": path,
133
  "name": name,
134
+ "root":root,
135
+ "targetElement":targetElement
136
  }
137
  websockets.broadcast(connected,json.dumps(event))
138
 
 
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['targetElement'], connected)
343
 
344
 
345
  elif event["command"]["type"]=="delete":