Home | Trees | Indices | Help |
---|
|
Provide operations for watching files and directories. Its internal dictionary is used to reference watched items. When used inside threaded code, one must instanciate as many WatchManager instances as there are ThreadedNotifier instances.
|
|||
|
|||
|
|||
int |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
dict of {str: int} |
|
||
list of int |
|
||
dict of {int: bool} |
|
||
list of type(param) |
|
||
int or None |
|
||
string or None |
|
||
string |
|
||
dict of {int: bool} |
|
||
Same as add_watch(). |
|
||
|
|||
|
|||
Inherited from |
|
|||
dict |
watches Get a reference on the internal watch manager dictionary. |
||
ignore_events | |||
Inherited from |
|
Initialization: init inotify, init watch manager dictionary. Raise OSError if initialization fails, raise InotifyBindingNotFoundError if no inotify binding was found (through ctypes or from direct access to syscalls).
|
Close inotify's file descriptor, this action will also automatically remove (i.e. stop watching) all its associated watch descriptors. After a call to this method the WatchManager's instance become useless and cannot be reused, a new instance must then be instanciated. It makes sense to call this method in few situations for instance if several independant WatchManager must be instanciated or if all watches must be removed and no other watches need to be added. |
Return assigned inotify's file descriptor.
|
Get watch from provided watch descriptor wd.
|
Remove watch entry associated to watch descriptor wd.
|
Add a watch on path, build a Watch object and insert it in the watch manager dictionary. Return the wd value. |
Add watch(s) on the provided |path|(s) with associated |mask| flag value and optionally with a processing |proc_fun| function and recursive flag |rec| set to True. Ideally |path| components should not be unicode objects. Note that although unicode paths are accepted there are converted to byte strings before a watch is put on that path. The encoding used for converting the unicode object is given by sys.getfilesystemencoding(). If |path| is already watched it is ignored, but if it is called with option rec=True a watch is put on each one of its not-watched subdirectory.
|
Get every wd from self._wmd if its path is under the path of one (at least) of those in lpath. Doesn't follow symlinks.
|
Update existing watch descriptors |wd|. The |mask| value, the processing object |proc_fun|, the recursive param |rec| and the |auto_add| and |quiet| flags can all be updated.
|
|
Returns the watch descriptor associated to path. This method presents a prohibitive cost, always prefer to keep the WD returned by add_watch(). If the path is unknown it returns None.
|
Returns the path associated to WD, if WD is unknown it returns None.
|
Yields each subdirectories of top, doesn't follow symlinks. If rec is false, only yield top.
|
Removes watch(s).
|
Watch a transient file, which will be created and deleted frequently over time (e.g. pid file).
Attention: Currently under the call to this function it is not possible to correctly watch the events triggered into the same base directory than the directory where is located this watched transient file. For instance it would be wrong to make these two successive calls: wm.watch_transient_file('/var/run/foo.pid', ...) and wm.add_watch('/var/run/', ...) |
|
watchesGet a reference on the internal watch manager dictionary.
|
ignore_events
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jun 4 11:54:21 2015 | http://epydoc.sourceforge.net |