import threading
import time
-from watchdog.events import FileSystemEventHandler
+from watchdog.events import DirDeletedEvent, FileDeletedEvent, FileSystemEventHandler
from watchdog.observers import Observer
class DirTrigger(FileSystemEventHandler):
self._last_reset_time = time.time()
def on_any_event(self, event):
+ if event.event_type == FileDeletedEvent or event.event_type == DirDeletedEvent:
+ return
+
self._lock.acquire()
try:
self._got_event = True