https://github.com/alice1017/justwatch
Just watch the file modification
https://github.com/alice1017/justwatch
python2 watch
Last synced: about 1 month ago
JSON representation
Just watch the file modification
- Host: GitHub
- URL: https://github.com/alice1017/justwatch
- Owner: alice1017
- License: mit
- Created: 2018-04-06T00:20:46.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-20T15:40:15.000Z (about 6 years ago)
- Last Synced: 2025-03-15T22:48:01.142Z (2 months ago)
- Topics: python2, watch
- Language: Python
- Homepage:
- Size: 871 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JustWatch
[](http://forthebadge.com)
[](https://travis-ci.org/alice1017/JustWatch)
[](https://coveralls.io/github/alice1017/JustWatch)[](https://asciinema.org/a/175956)
## :page_facing_up: Overview
Python utility to watch the **file modification**.
There are similar libraries: [pyinotify](https://github.com/seb-m/pyinotify), [watchdog](https://github.com/gorakhargosh/watchdog).
These libraries watch the file system event, but JustWatch is supported modification **only**.## :pencil2: Usage
### quick start
First of all, import classes from `justwatch`:
```py
from justwatch import WatchManager, Observer
```make `WatchManager` instance and add file or directory:
```py
manager = WatchManager()
manager.add_file("./README.md")
manager.add_dir("./tests")
```make `Observer` instance and set callback:
```py
observer = Observer(manager)@observer.set_callback
def callback(item):
print "Catch the modification of '{0}'".format(item.path)
```and run `observer.watch`
```py
observer.watch()
```### example
## :inbox_tray: Installation
```
$ git clone [email protected]:alice1017/JustWatch.git
$ cd JustWatch
$ python setup.py build install
```or
```
$ pip install just-watch
```## :eyes: Contribution
1. Forks on [Github](https://github.com/alice1017/JustWatch)
2. Find a bug? Send a pull request to get it merged and published.