cc-4235: added debugging statements

This commit is contained in:
Rudi Grinberg 2012-08-16 11:23:01 -04:00
parent ecbde40979
commit d50c4ded6b
2 changed files with 6 additions and 4 deletions

View File

@ -61,18 +61,18 @@ def mediate_ignored(fn):
return wrapped
class BaseListener(object):
def my_init(self, signal):
self.signal = signal
def my_init(self, signal): self.signal = signal
class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable):
def process_IN_CLOSE_WRITE(self, event):
self.logger.info("===> IN_CLOSE_WRITE : '%s'" % event.pathname)
self.process_to_organize(event)
# got cookie
def process_IN_MOVED_TO(self, event):
self.logger.info("===> IN_MOVED_TO : '%s'" % event.pathname)
self.process_to_organize(event)
def process_default(self, event):
self.logger.info("===> Not handling: '%s'" % str(event))
def flush_events(self, path):
"""
organize the whole directory at path. (pretty much by doing what

View File

@ -67,6 +67,8 @@ class Manager(Loggable):
del(self.__wd_path[path])
def __add_watch(self,path,listener):
self.logger.info("Adding listener '%s' to '%s'" %
( listener.__class__.__name__, path) )
wd = self.wm.add_watch(path, pyinotify.ALL_EVENTS, rec=True,
auto_add=True, proc_fun=listener)
self.__wd_path[path] = wd.values()[0]