Ramesh-vani commited on
Commit
3d1ce57
·
verified ·
1 Parent(s): 087bfde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -31,7 +31,7 @@ class FileHandler(FileSystemEventHandler):
31
  return
32
  with open(event.src_path, 'r', encoding='utf-8') as file:
33
  content = file.read()
34
- # print(f'File {event.src_path} has been modified.')
35
  new_event = {
36
  "type": "file-modifie",
37
  "content": content,
@@ -53,7 +53,7 @@ class FileHandler(FileSystemEventHandler):
53
  else:
54
  with open(event.src_path, 'r', encoding='utf-8') as file:
55
  content = file.read()
56
- # print(f'File {event.src_path} has been created.')
57
  new_event = {
58
  "type": "file-create",
59
  "content": content,
@@ -74,12 +74,13 @@ class FileHandler(FileSystemEventHandler):
74
  }
75
  websockets.broadcast(self.connected,json.dumps(new_event))
76
  else:
77
- # print(f'File {event.src_path} has been deleted.')
78
  new_event = {
79
  "type": "delete",
80
  "name": event.src_path.split('/')[-1],
81
  "path": event.src_path,
82
  }
 
83
  websockets.broadcast(self.connected,json.dumps(new_event))
84
 
85
  def on_moved(self, event):
 
31
  return
32
  with open(event.src_path, 'r', encoding='utf-8') as file:
33
  content = file.read()
34
+ print(f'File {event.src_path} has been modified.')
35
  new_event = {
36
  "type": "file-modifie",
37
  "content": content,
 
53
  else:
54
  with open(event.src_path, 'r', encoding='utf-8') as file:
55
  content = file.read()
56
+ print(f'File {event.src_path} has been created.')
57
  new_event = {
58
  "type": "file-create",
59
  "content": content,
 
74
  }
75
  websockets.broadcast(self.connected,json.dumps(new_event))
76
  else:
77
+ print(f'File {event.src_path} has been deleted.')
78
  new_event = {
79
  "type": "delete",
80
  "name": event.src_path.split('/')[-1],
81
  "path": event.src_path,
82
  }
83
+ print(event.src_path)
84
  websockets.broadcast(self.connected,json.dumps(new_event))
85
 
86
  def on_moved(self, event):