From c564b645304a4144c37264cf3afa24d8c362661f Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 2 Sep 2014 22:01:50 +0400 Subject: [PATCH] Add `is_watching` method to UvWatcher class Fixes #1052 --- powerline/lib/watcher/uv.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/powerline/lib/watcher/uv.py b/powerline/lib/watcher/uv.py index 26e9dbfe..88b64366 100644 --- a/powerline/lib/watcher/uv.py +++ b/powerline/lib/watcher/uv.py @@ -87,6 +87,10 @@ class UvWatcher(object): return watch.close(partial(self._stopped_watching, path)) + def is_watching(self, path): + with self.lock: + return path in self.watches + def __del__(self): try: lock = self.lock