MM2: added some docstrings to Manager.py

This commit is contained in:
Rudi Grinberg 2012-08-28 17:39:25 -04:00
parent 21bad35c39
commit 416bb5fb2b
1 changed files with 12 additions and 1 deletions

View File

@ -79,9 +79,16 @@ class Manager(Loggable):
watch_dir)
self.remove_watch_directory(normpath(watch_dir))
def watch_signal(self): return self.watch_listener.signal
def watch_signal(self):
"""
Return the signal string our watch_listener is reading events from
"""
return self.watch_listener.signal
def __remove_watch(self,path):
"""
Remove path from being watched (first will check if 'path' is watched)
"""
# only delete if dir is actually being watched
if path in self.__wd_path:
wd = self.__wd_path[path]
@ -89,6 +96,10 @@ class Manager(Loggable):
del(self.__wd_path[path])
def __add_watch(self,path,listener):
"""
Start watching 'path' using 'listener'. First will check if directory
is being watched before adding another watch
"""
self.logger.info("Adding listener '%s' to '%s'" %
( listener.__class__.__name__, path) )
if not self.has_watch(path):