The INotify file descriptor, it basically does everything related to INotify, from reading to notifying watch points.

Method __init__
Method connectionLost Release the inotify file descriptor and do the necessary cleanup
Method fileno Get the underlying file descriptor from this inotify observer. Required by abstract.FileDescriptor subclasses.
Method doRead Read some data from the observed file descriptors
Method watch Watch the 'mask' events in given path. Can raise INotifyError when there's a problem while adding a directory.
Method ignore Remove the watch point monitoring the given path
Instance Variable _buffer a str containing the data read from the inotify fd.
Instance Variable _watchpoints a dict that maps from inotify watch ids to watchpoints objects
Instance Variable _watchpaths a dict that maps from watched paths to the inotify watch ids
Method _addWatch Private helper that abstracts the use of ctypes.
Method _rmWatch Private helper that abstracts the use of ctypes.
Method _doRead Work on the data just read from the file descriptor.
Method _addChildren This is a very private method, please don't even think about using it.
Method _isWatched Helper function that checks if the path is already monitored and returns its watchdescriptor if so or None otherwise.

Inherited from _LogOwner (via FileDescriptor):

Method logPrefix Override this method to insert custom logging behavior. Its return value will be inserted in front of every line. It may be called more times than the number of output lines.
Method _getLogPrefix Determine the log prefix to use for messages related to applicationObject, which may or may not be an interfaces.ILoggingContext provider.

Inherited from _LogOwner (via FileDescriptor):

Method logPrefix Override this method to insert custom logging behavior. Its return value will be inserted in front of every line. It may be called more times than the number of output lines.
Method _getLogPrefix Determine the log prefix to use for messages related to applicationObject, which may or may not be an interfaces.ILoggingContext provider.

Inherited from _LogOwner (via FileDescriptor):

Method logPrefix Override this method to insert custom logging behavior. Its return value will be inserted in front of every line. It may be called more times than the number of output lines.
Method _getLogPrefix Determine the log prefix to use for messages related to applicationObject, which may or may not be an interfaces.ILoggingContext provider.
_buffer =
a str containing the data read from the inotify fd.
_watchpoints =
a dict that maps from inotify watch ids to watchpoints objects
_watchpaths =
a dict that maps from watched paths to the inotify watch ids
def __init__(self, reactor=None): (source)
ParametersreactorAn IReactorFDSet provider which this descriptor will use to get readable and writeable event notifications. If no value is given, the global reactor will be used.
def _addWatch(self, path, mask, autoAdd, callbacks): (source)

Private helper that abstracts the use of ctypes.

Calls the internal inotify API and checks for any errors after the call. If there's an error INotify._addWatch can raise an INotifyError. If there's no error it proceeds creating a watchpoint and adding a watchpath for inverse lookup of the file descriptor from the path.

def _rmWatch(self, wd): (source)

Private helper that abstracts the use of ctypes.

Calls the internal inotify API to remove an fd from inotify then removes the corresponding watchpoint from the internal mapping together with the file descriptor from the watchpath.

def connectionLost(self, reason): (source)

Release the inotify file descriptor and do the necessary cleanup

def fileno(self): (source)

Get the underlying file descriptor from this inotify observer. Required by abstract.FileDescriptor subclasses.

def doRead(self): (source)

Read some data from the observed file descriptors

def _doRead(self, in_): (source)

Work on the data just read from the file descriptor.

def _addChildren(self, iwp): (source)

This is a very private method, please don't even think about using it.

Note that this is a fricking hack... it's because we cannot be fast enough in adding a watch to a directory and so we basically end up getting here too late if some operations have already been going on in the subdir, we basically need to catchup. This eventually ends up meaning that we generate double events, your app must be resistant.

def watch(self, path, mask=IN_WATCH_MASK, autoAdd=False, callbacks=None, recursive=False): (source)

Watch the 'mask' events in given path. Can raise INotifyError when there's a problem while adding a directory.

ParameterspathThe path needing monitoring (type: FilePath)
maskThe events that should be watched (type: int)
autoAddif True automatically add newly created subdirectories (type: boolean)
callbacksA list of callbacks that should be called when an event happens in the given path. The callback should accept 3 arguments: (ignored, filepath, mask) (type: list of callables)
recursiveAlso add all the subdirectories in this path (type: boolean)
def ignore(self, path): (source)

Remove the watch point monitoring the given path

ParameterspathThe path that should be ignored (type: FilePath)
def _isWatched(self, path): (source)

Helper function that checks if the path is already monitored and returns its watchdescriptor if so or None otherwise.

ParameterspathThe path that should be checked (type: FilePath)
API Documentation for Twisted, generated by pydoctor at 2016-05-18 16:01:36.