Created
March 2, 2010 22:12
-
-
Save Visgean/320021 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# -*- coding: UTF-8 -*- | |
import pyinotify | |
class notifier(pyinotify.ProcessEvent): | |
def process_IN_ACCESS(self, event): | |
"file was accessed." | |
pass | |
def process_IN_ATTRIB(self, event): | |
"metadata changed." | |
pass | |
def process_IN_CLOSE_NOWRITE(self, event): | |
"unwritable file was closed." | |
pass | |
def process_IN_CLOSE_WRITE(self, event): | |
"writable file was closed." | |
pass | |
def process_IN_CREATE(self, event): | |
"file/dir was created in watched directory." | |
pass | |
def process_IN_DELETE(self, event): | |
"file/dir was deleted in watched directory." | |
pass | |
def process_IN_DELETE_SELF(self, event): | |
"watched item itself was deleted." | |
pass | |
def process_IN_DONT_FOLLOW(self, event): | |
"don't follow a symlink (lk 2.6.15)." | |
pass | |
def process_IN_IGNORED(self, event): | |
"raised when a watch is removed. Probably useless for you, prefer instead IN_DELETE*." | |
pass | |
def process_IN_ISDIR(self, event): | |
"event occurred against a directory. It is always piggybacked with an event. The Event structure automatically provides this information via attribute event.is_dir" | |
pass | |
def process_IN_MASK_ADD(self, event): | |
"to update a mask without overwriting the previous value (lk 2.6.14). Useful when updating a watch." | |
pass | |
def process_IN_MODIFY(self, event): | |
"file was modified." | |
pass | |
def process_IN_MOVE_SELF(self, event): | |
"watched item itself was moved, currently its full pathname destination can only be known if its source directory and destination directory are both watched. Otherwise, the file is still being watched but you cannot rely anymore on the given path attribute event.path" | |
pass | |
def process_IN_MOVED_FROM(self, event): | |
"file/dir in a watched dir was moved from X. Can trace the full move of an item when IN_MOVED_TO is available too, in this case if the moved item is itself watched, its path will be updated (see IN_MOVE_SELF)." | |
pass | |
def process_IN_MOVED_TO(self, event): | |
"file/dir was moved to Y in a watched dir (see IN_MOVE_FROM)." | |
pass | |
def process_IN_ONLYDIR(self, event): | |
"only watch the path if it is a directory (lk 2.6.15). Usable when calling watch_manager.add_watch()." | |
pass | |
def process_IN_OPEN(self, event): | |
"file was opened." | |
pass | |
def process_IN_Q_OVERFLOW(self, event): | |
"event's queue overflown. This event doesn't is not associated with a watch." | |
pass | |
def process_IN_UNMOUNT(self, event): | |
"backing fs was unmounted. Notified to each watch of this fs." | |
pass | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment