You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature description
Add tree_depth parameter to an InotifyTree __init__, thus add option to limit the number of created watchers. Or add watch path_mask.
Problem at hand
I have a wast tree of directories that goes something like this:
- parent_dir
- date
- time
- [some_data_files]
The files from date/time are being constantly removed from my system and new date and time directories are being added. Let's say this operations are performed at random order. For my purposes, it would be convenient to add watchers only to first 3 levels of this tree, or add a filter predicate at the beginning of the process.
Possible resulting interface
The resulting interface, as I see it, might be something like this:
import inotofy.adapters
tree_watcher = inotify.adapters.InotifyTree("/my/folder/path", tree_depth=2)
for event in tree_watcher.event_gen():
# do my work here
or something like this:
import inotofy.adapters
tree_watcher = inotify.adapters.Inotfy()
watcher = tree_watcher.add_watch("/my/folder/path/*/*")
for event in watcher.event_gen():
# do my work here
or even something like this
import inotofy.adapters
tree_watcher = inotify.adapters.InotifyTree("/my/folder/path", filter_mask="(.+)?.my.file.path.regex")
for event in watcher.event_gen():
# do my work here
If I understand this correctly, there is no way to do it with current implementation. Or is there some way?
I think I'll try to add a patch on my side for this, but if this may be interesting to anyone here, I'd be glad to share it.
The text was updated successfully, but these errors were encountered:
Feature description
Add
tree_depth
parameter to an InotifyTree__init__
, thus add option to limit the number of created watchers. Or add watchpath_mask
.Problem at hand
I have a wast tree of directories that goes something like this:
The files from date/time are being constantly removed from my system and new date and time directories are being added. Let's say this operations are performed at random order. For my purposes, it would be convenient to add watchers only to first 3 levels of this tree, or add a filter predicate at the beginning of the process.
Possible resulting interface
The resulting interface, as I see it, might be something like this:
or something like this:
or even something like this
If I understand this correctly, there is no way to do it with current implementation. Or is there some way?
I think I'll try to add a patch on my side for this, but if this may be interesting to anyone here, I'd be glad to share it.
The text was updated successfully, but these errors were encountered: