Skip to main content

Python File Watcher

Project description

https://travis-ci.org/benemery/filewatch.svg?branch=master https://coveralls.io/repos/benemery/filewatch/badge.svg?branch=master&foo=bar

FILEWATCH

Keep track of what files change and when with this super easy to use package.

Installation

Install using pip:

$ pip install filewatch

Then create and register your observer:

# your_observer.py
from filewatch import ObserverBase, file_updated_subject, Watcher

class YourObserver(ObserverBase):
    def notify(self, *args, **kwargs):
        file_list = kwargs['file_list']
        print 'These files have been updated %s' % file_list

file_updated_subject.register_observer(YourObserver())
watcher = Watcher()
watcher.run()

Then simply execute the file:

$ python your_observer.py

Now every time that a file is created / modified within your current working directory, the system will print to console which file was updated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

filewatch-0.2.0.tar.gz (3.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page