PyInotify
PyInotify copied to clipboard
Add watch directly on pathlib instances
The add_watch function only supports strings when supplying the path to watch. Thus, if one uses Python 3.4's pathlib module for paths, it has to be converted to a string first when adding a watch:
path = pathlib.Path('a/path')
i = inotify.adapters.Inotify()
i.add_watch(str(path))
While minor, it could be useful to allow passing pathlib instances directly:
path = pathlib.Path('a/path')
i = inotify.adapters.Inotify()
i.add_watch(path)