Ramesh-vani commited on
Commit
5cb91d4
·
verified ·
1 Parent(s): 86d34b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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,root,targetElement,rpath, connected):
125
  file_path = os.path.join(os.getcwd(), 'projects', key,project_name, rpath,name)
126
  # Create the file
127
  with open(file_path, 'w'):
@@ -132,7 +132,7 @@ async def create_file(websocket, key,project_name, path,name,root,targetElement,
132
  "path": path,
133
  "name": name,
134
  "root":root,
135
- "targetElement":targetElement
136
  }
137
  websockets.broadcast(connected,json.dumps(event))
138
 
@@ -339,7 +339,7 @@ async def exe(websocket,connected,key):
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'],event["rpath"], connected)
343
 
344
 
345
  elif event["command"]["type"]=="delete":
 
121
 
122
 
123
 
124
+ async def create_file(websocket, key,project_name, path,name,root,targetElementData,rpath, connected):
125
  file_path = os.path.join(os.getcwd(), 'projects', key,project_name, rpath,name)
126
  # Create the file
127
  with open(file_path, 'w'):
 
132
  "path": path,
133
  "name": name,
134
  "root":root,
135
+ "targetElementData":targetElementData
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['targetElementData'],event["rpath"], connected)
343
 
344
 
345
  elif event["command"]["type"]=="delete":