X-Git-Url: http://git.treefish.org/~alex/photosort.git/blobdiff_plain/e7b340f1a05c4ef9a28a427d34ff12f14113c95c..7baa51e585d73c13648e246e07f87bb0365ddc6c:/src/dirtrigger.py diff --git a/src/dirtrigger.py b/src/dirtrigger.py index 7978df3..2ea981c 100644 --- a/src/dirtrigger.py +++ b/src/dirtrigger.py @@ -1,6 +1,6 @@ import threading import time -from watchdog.events import FileSystemEventHandler +from watchdog.events import DirDeletedEvent, FileDeletedEvent, FileSystemEventHandler from watchdog.observers import Observer class DirTrigger(FileSystemEventHandler): @@ -35,6 +35,9 @@ 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