Commit db8630d9 by rfkelly0

WatchableFile: only send MODIFIED events if the file is writable

parent 9d33de0d
...@@ -259,11 +259,13 @@ class WatchedFile(object): ...@@ -259,11 +259,13 @@ class WatchedFile(object):
def flush(self): def flush(self):
self.file.flush() self.file.flush()
self.fs.notify_watchers(MODIFIED,self.path,True) if "w" in self.mode or "a" in self.mode or "+" in self.mode:
self.fs.notify_watchers(MODIFIED,self.path,True)
def close(self): def close(self):
self.file.close() self.file.close()
self.fs.notify_watchers(MODIFIED,self.path,True) if "w" in self.mode or "a" in self.mode or "+" in self.mode:
self.fs.notify_watchers(MODIFIED,self.path,True)
class WatchableFS(WatchableFSMixin,WrapFS): class WatchableFS(WatchableFSMixin,WrapFS):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment