Skip to content

alice1017/JustWatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JustWatch

forthebadge

Build Status Coverage Status

asciicast

📄 Overview

Python utility to watch the file modification. There are similar libraries: pyinotify, watchdog. These libraries watch the file system event, but JustWatch is supported modification only.

✏️ Usage

quick start

First of all, import classes from justwatch:

from justwatch import WatchManager, Observer

make WatchManager instance and add file or directory:

manager = WatchManager()
manager.add_file("./README.md")
manager.add_dir("./tests")

make Observer instance and set callback:

observer = Observer(manager)

@observer.set_callback
def callback(item):
    print "Catch the modification of '{0}'".format(item.path)

and run observer.watch

observer.watch()

example

sample code

📥 Installation

$ git clone git@github.com:alice1017/JustWatch.git
$ cd JustWatch
$ python setup.py build install

or

$ pip install just-watch

👀 Contribution

  1. Forks on Github
  2. Find a bug? Send a pull request to get it merged and published.

About

Just watch the file modification

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages