https://github.com/pauleveritt/pyramid_watcher
Watch a directory in Pyramid and register callbacks for handling files
https://github.com/pauleveritt/pyramid_watcher
pyramid reload web
Last synced: 2 days ago
JSON representation
Watch a directory in Pyramid and register callbacks for handling files
- Host: GitHub
- URL: https://github.com/pauleveritt/pyramid_watcher
- Owner: pauleveritt
- License: mit
- Created: 2019-02-16T14:47:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-05T01:44:21.000Z (over 7 years ago)
- Last Synced: 2025-10-09T18:43:45.719Z (9 months ago)
- Topics: pyramid, reload, web
- Language: Python
- Homepage: https://pyramid-watcher.readthedocs.io/en/latest/
- Size: 95.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
===============
pyramid_watcher
===============
.. image:: https://readthedocs.org/projects/pyramid_watcher/badge/?version=latest
:target: https://readthedocs.org/projects/pyramid_watcher/?badge=latest
:alt: Documentation Status
Want to watch your local files and take actions, including reloading a
browser, when add/edit/change modifications are detected?
pyramid_watcher works in a background thread and lets you register
handlers.
This package is written specifically as a start to a static-site
generator which watches Markdown files.
Docs
====
Docs for pyramid_watcher are hosted
`on ReadTheDocs `_.
Scanning
========
This package uses Python's builtin
`scandir `_
module from `PEP 471 `_
and thus requires Python 3.5 or higher. As noted by Samuel Colvin in
the README for `watchgod `_, this
approach is plenty fast and mitigates the need to use OS-native
filesystem watching.
Acknowledgements
================
The world of JavaScript has tons of tools like webpack-dev-server which
watch for changes and go through rich pipelines to then do interesting
reload operations in the browser.
Hsiaoming Yang (lepture) manages a `livereload `_
package which does much of this. I wanted a few differences: integration
with Pyramid in a rich way, higher-performance watching, and batch
operations.
Samuel Colvin's `watchgod `_ was the
architectural inspiration. The ``scandir`` approach and code was taken
directly from his ``watchers.py`` file. His package does more things and
is dependent on asyncio stuff.
Michael Merickel's `hupper `_ gave me
the background thread approach registered with Pyramid. Far more
importantly, Michael coached me through the entirety of writing this.