diff --git a/lib/tfw/components/inotify/inotify.py b/lib/tfw/components/inotify/inotify.py index 2cf9523..33b0936 100644 --- a/lib/tfw/components/inotify/inotify.py +++ b/lib/tfw/components/inotify/inotify.py @@ -68,7 +68,8 @@ class InotifyObserver: self._path = path self._patterns = patterns self._exclude = exclude - self.observer = Observer() + self._recursive = recursive + self._observer = Observer() self._reset(path, patterns, exclude) def _reset(self, path, patterns, exclude): @@ -77,8 +78,8 @@ class InotifyObserver: def on_any_event(self, event): dispatch_event(event) self.handler = TransformerEventHandler(patterns, exclude) - self.observer.unschedule_all() - self.observer.schedule(self.handler, path, recursive) + self._observer.unschedule_all() + self._observer.schedule(self.handler, path, self._recursive) @property def path(self): @@ -108,11 +109,11 @@ class InotifyObserver: self._reset(self._path, self._patterns, exclude) def start(self): - self.observer.start() + self._observer.start() def stop(self): - self.observer.stop() - self.observer.join() + self._observer.stop() + self._observer.join() def dispatch_event(self, event): event_to_action = {