Ramesh-vani commited on
Commit
8ef812a
·
verified ·
1 Parent(s): 4070523

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -184,26 +184,26 @@ async def exe(websocket,connected):
184
  try:
185
  if event["command"]["type"]=="shell":
186
  await execute_command(websocket, event["project_name"], event["command"]["command"], connected)
187
- elif "write" in event:
188
 
189
  await wirte_file(websocket, event["project_name"], event["path"], event["content"], connected)
190
- elif "create" in event:
191
  if event["item"]=="folder":
192
  await create_folder(websocket, event["project_name"], event["path"], connected)
193
  else:
194
  await create_file(websocket, event["project_name"], event["path"], connected)
195
 
196
  await wirte_file(websocket, event["project_name"], event["path"], event["content"], connected) #Todo
197
- elif "delete" in event:
198
 
199
  await wirte_file(websocket, event["project_name"], event["path"], event["content"], connected) #Todo
200
- elif "rename" in event:
201
 
202
  await wirte_file(websocket, event["project_name"], event["path"], event["content"], connected) #Todo
203
 
204
  else:
205
  # First player starts a new game.
206
- await start(websocket, message)
207
  except RuntimeError as exc:
208
  # Send an "error" event if the move was illegal.
209
  await error(websocket, str(exc))
 
184
  try:
185
  if event["command"]["type"]=="shell":
186
  await execute_command(websocket, event["project_name"], event["command"]["command"], connected)
187
+ elif event["command"]["type"]=="write":
188
 
189
  await wirte_file(websocket, event["project_name"], event["path"], event["content"], connected)
190
+ elif event["command"]["type"]=="create":
191
  if event["item"]=="folder":
192
  await create_folder(websocket, event["project_name"], event["path"], connected)
193
  else:
194
  await create_file(websocket, event["project_name"], event["path"], connected)
195
 
196
  await wirte_file(websocket, event["project_name"], event["path"], event["content"], connected) #Todo
197
+ elif event["command"]["type"]=="delete":
198
 
199
  await wirte_file(websocket, event["project_name"], event["path"], event["content"], connected) #Todo
200
+ elif event["command"]["type"]=="rename":
201
 
202
  await wirte_file(websocket, event["project_name"], event["path"], event["content"], connected) #Todo
203
 
204
  else:
205
  # First player starts a new game.
206
+ pass
207
  except RuntimeError as exc:
208
  # Send an "error" event if the move was illegal.
209
  await error(websocket, str(exc))