diff sat_frontends/jp/cmd_blog.py @ 3000:d603550d5e99

jp (blog/preview): fixed watch restoring when file is moved/deleted: with some editors (e.g. vim), when file is written it is actually replaced with a buffered one. In this case, jp replace the watch to check the new file, but it was not working anymore with latest version of inotify module. This patch fixes it by removing the old watch before adding a new one.
author Goffi <goffi@goffi.org>
date Fri, 12 Jul 2019 11:29:05 +0200
parents a1b98772af6b
children ab2696e34d29
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_blog.py	Fri Jul 12 11:24:22 2019 +0200
+++ b/sat_frontends/jp/cmd_blog.py	Fri Jul 12 11:29:05 2019 +0200
@@ -801,6 +801,7 @@
                                 ),
                                 2,
                             )
+                            i.remove_watch(self.content_file_path)
                             try:
                                 add_watch()
                             except InotifyError: