contentmonster/classes/doghandler.py

18 lines
589 B
Python
Raw Normal View History

2021-11-22 10:14:38 +00:00
from watchdog.events import FileSystemEventHandler
class DogHandler(FileSystemEventHandler):
def __init__(self, queue, *args, **kwargs):
super().__init__(*args, **kwargs)
self._queue = queue
def on_created(self, event):
2021-11-23 07:30:31 +00:00
self._queue.put("Created: " + event.src_path)
2021-11-22 10:14:38 +00:00
def on_modified(self, event):
2021-11-23 07:30:31 +00:00
self._queue.put("Modified: " + event.src_path)
2021-11-22 10:14:38 +00:00
def on_moved(self, event):
2021-11-23 07:30:31 +00:00
self._queue.put("Moved: " + event.src_path + " to: " + event.dest_path)
2021-11-22 10:14:38 +00:00
def on_deleted(self, event):
2021-11-23 07:30:31 +00:00
self._queue.put("Deleted: " + event.src_path)