Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -56,12 +56,16 @@ async def rename_item(websocket, key,project_name, path,new_name, connected):
|
|
56 |
event = {
|
57 |
"type": "rename-success",
|
58 |
"data": f'{old_path}-->{new_path}',
|
|
|
|
|
59 |
}
|
60 |
websockets.broadcast(connected,json.dumps(event))
|
61 |
else:
|
62 |
event = {
|
63 |
"type": "rename-failed",
|
64 |
"data": f'{old_path}-->{new_path} failed Item not found',
|
|
|
|
|
65 |
}
|
66 |
websockets.broadcast(connected,json.dumps(event))
|
67 |
except Exception as e:
|
@@ -80,7 +84,7 @@ async def delete_item(websocket, key,project_name, path, connected):
|
|
80 |
|
81 |
event = {
|
82 |
"type": "delete-success",
|
83 |
-
"data":
|
84 |
}
|
85 |
websockets.broadcast(connected,json.dumps(event))
|
86 |
# websockets.broadcast(connected,'success')
|
@@ -102,6 +106,8 @@ async def create_file(websocket, key,project_name, path,name, connected):
|
|
102 |
event = {
|
103 |
"type": "file-created",
|
104 |
"data": file_path,
|
|
|
|
|
105 |
}
|
106 |
websockets.broadcast(connected,json.dumps(event))
|
107 |
|
|
|
56 |
event = {
|
57 |
"type": "rename-success",
|
58 |
"data": f'{old_path}-->{new_path}',
|
59 |
+
"old_path": path,
|
60 |
+
"new_name": new_name,
|
61 |
}
|
62 |
websockets.broadcast(connected,json.dumps(event))
|
63 |
else:
|
64 |
event = {
|
65 |
"type": "rename-failed",
|
66 |
"data": f'{old_path}-->{new_path} failed Item not found',
|
67 |
+
"old_path": path,
|
68 |
+
"new_name": new_name,
|
69 |
}
|
70 |
websockets.broadcast(connected,json.dumps(event))
|
71 |
except Exception as e:
|
|
|
84 |
|
85 |
event = {
|
86 |
"type": "delete-success",
|
87 |
+
"data": path,
|
88 |
}
|
89 |
websockets.broadcast(connected,json.dumps(event))
|
90 |
# websockets.broadcast(connected,'success')
|
|
|
106 |
event = {
|
107 |
"type": "file-created",
|
108 |
"data": file_path,
|
109 |
+
"path": path,
|
110 |
+
"name": name,
|
111 |
}
|
112 |
websockets.broadcast(connected,json.dumps(event))
|
113 |
|