Wishlist: recursive watching for a file pattern
See original GitHub issueI want to run a command whenever a filename matching a particular glob pattern (*.rst
) changes in a directory tree.
I can watch the directory tree recursively with server.watch('directory/')
, but this triggers for other kinds of files as well.
I can watch for a glob pattern (*.rst
), but this doesn’t support recursive globbing (yet).
Possible solutions:
- implement
'**/*.rst'
-style globbing (perhaps backport the feature from Python 3.5?) - add a
filter
argument so I could sayserver.watch('.', filter=lambda fn: fn.endswith('.rst'), func='make html')
Note that a solution to manually use an external library for file globbing, like the one suggested in the manual, is unsuitable because it would not pick up newly-created files or subdirectories.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Recursive patterned File Globbing - CodeProject
Class and application to recursively or non-recursively match files or directories based on a wildcard pattern.
Read more >Recursively looking for a list of file types - Stack Overflow
I want to use bash to remove all the files in a directory that aren't in an associative array of ...
Read more >watchr - npm
Watchr provides a normalised API the file watching APIs of different node versions, nested/recursive file and directory watching, and accurate detailed ...
Read more >Solved: recursive file list pattern - NI Community
Solved: Hello, I have created a subvi that searches through a main folder for specific files and adds them to a compressed folder....
Read more >Untitled
Zstdgrep recursive. They must be defined somewhere at system level and not just at user level. In Linux, system-wide configuration files are located...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve added an
ignore
parameter on watch https://github.com/lepture/python-livereload/commit/26c70a709b6b74dae02c6a4548b393255c08cf59See https://github.com/lepture/python-livereload/pull/127