Skip to content

Latest commit

 

History

History
54 lines (31 loc) · 1021 Bytes

File metadata and controls

54 lines (31 loc) · 1021 Bytes

WatchFolder

Features

watchdog is used to get system events.

  • folders monitoring
  • file sequence and video treatment

Simple usage example

#!/usr/bin/env python


import time
from monitor import Monitor


def callback(file_path):
    '''Callback function

    file_path : absolute path of a completed file

    This function will be call by the Monitor instance each time a file
    is completed.

    '''
    print file_path, 'is completed !'


monitor = Monitor('.', callback)  # Monitor cur directory
monitor.start()                   # Start thread
try:
    while True:
        time.sleep(1)
except KeyboardInterrupt:
monitor.stop()                    # Stop thread and wait until it terminates
print 'All is over !'

Installation

setuptools installation :

python setup.py install