Package wafadmin :: Package Tools :: Module DirWatch :: Class DirectoryWatcher
[hide private]
[frames] | no frames]

Class DirectoryWatcher

source code

DirWatch chooses a supported backend (fam, gamin or fallback) it is mainly a wrapper script without own methods beside this

Instance Methods [hide private]
 
__init__(self) source code
 
__del__(self) source code
 
_raise_disconnected(self) source code
 
disconnect(self) source code
 
connect(self) source code
 
add_watch(self, idxName, callBackThis, dirList, handleEvents=['changed','deleted','created'])
add dirList to watch.
source code
 
remove_watch(self, idxName)
remove DirWatch with name idxName
source code
 
remove_all_watch(self)
remove all DirWatcher
source code
 
suspend_watch(self, idxName)
suspend DirWatch with name idxName.
source code
 
suspend_all_watch(self)
suspend all DirWatcher ...
source code
 
resume_watch(self, idxName)
resume a DirWatch that was supended with suspendDirWatch or suspendAllDirWatch
source code
 
resume_all_watch(self)
resume all DirWatcher
source code
 
_processDirEvents(self, pathName, event, idxName) source code
 
request_end_loop(self)
sets a flag that stops the loop.
source code
 
loop(self)
wait for dir events and start handling of them
source code
Method Details [hide private]

add_watch(self, idxName, callBackThis, dirList, handleEvents=['changed','deleted','created'])

source code 

add dirList to watch.

Parameters:
  • idxName - unique name for ref
  • callBackThis - is called if something in dirs in dirlist has events (handleEvents) callBackThis(idxName, changedFilePath)
  • dirList - list of dirs to watch
  • handleEvents - events to handle possible are 'changed', 'deleted', 'created', 'exist' suspendDirWatch after a handled change

suspend_watch(self, idxName)

source code 

suspend DirWatch with name idxName. No dir/filechanges will be reacted until resume

suspend_all_watch(self)

source code 

suspend all DirWatcher ... they could be resumed with resume_all_watch

request_end_loop(self)

source code 

sets a flag that stops the loop. it do not stop the loop directly!