dsoprea / PyInotify

An efficient and elegant inotify (Linux filesystem activity monitor) library for Python. Python 2 and 3 compatible.
GNU General Public License v2.0
242 stars 73 forks source link

Fix remove_watch+ base tree.event gen #61

Closed Elias481 closed 5 years ago

Elias481 commented 5 years ago

Includes pull-requests #57 and #58 from XaF as changes are very related. Fixes the issue blocking #57 (superficial mode for IN_MOVED_FROM must be False as soon as remove_watch does not ignore this argument). And indirectly fixes #58 which is depending on #57 because both commits are now together... Additionally removed duplicate IN_MOVED_TO in same function.

Further fixes the issue that remove_watch_with_fd which is a public method can now be called standalone without causing inconsitencies.

And enhances the remove_watch so that it could ne used to remove only the fd from inotify. (There are use-cases for this.) Third state for superficial (None instead of True or False) used for that.

These fixes should obsolete issue #46 and #51 and my #59 (beside the idea for automatic unregistration on IN_IGNORE event but that just a nice to have idea and has no priority in my opinion).

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-2.2%) to 82.886% when pulling 9650e3000e382d62e3903de9919ae27f19b41b94 on Elias481:fix-remove_watch+_BaseTree.event_gen into 288a2b01fd4a726dc68d960f8351630aee788a13 on dsoprea:master.

Elias481 commented 5 years ago

Added testcase for issue #46 . Original result on current base can be found here: https://travis-ci.com/Elias481/PyInotify/builds/85639642

Elias481 commented 5 years ago

Added testcase for issue #51 . Original result on current base can be found here: https://travis-ci.com/Elias481/PyInotify/builds/85643184