cc-4235: added debugging statements
This commit is contained in:
parent
ecbde40979
commit
d50c4ded6b
|
@ -61,18 +61,18 @@ def mediate_ignored(fn):
|
||||||
return wrapped
|
return wrapped
|
||||||
|
|
||||||
class BaseListener(object):
|
class BaseListener(object):
|
||||||
def my_init(self, signal):
|
def my_init(self, signal): self.signal = signal
|
||||||
self.signal = signal
|
|
||||||
|
|
||||||
class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable):
|
class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable):
|
||||||
def process_IN_CLOSE_WRITE(self, event):
|
def process_IN_CLOSE_WRITE(self, event):
|
||||||
self.logger.info("===> IN_CLOSE_WRITE : '%s'" % event.pathname)
|
|
||||||
self.process_to_organize(event)
|
self.process_to_organize(event)
|
||||||
# got cookie
|
# got cookie
|
||||||
def process_IN_MOVED_TO(self, event):
|
def process_IN_MOVED_TO(self, event):
|
||||||
self.logger.info("===> IN_MOVED_TO : '%s'" % event.pathname)
|
|
||||||
self.process_to_organize(event)
|
self.process_to_organize(event)
|
||||||
|
|
||||||
|
def process_default(self, event):
|
||||||
|
self.logger.info("===> Not handling: '%s'" % str(event))
|
||||||
|
|
||||||
def flush_events(self, path):
|
def flush_events(self, path):
|
||||||
"""
|
"""
|
||||||
organize the whole directory at path. (pretty much by doing what
|
organize the whole directory at path. (pretty much by doing what
|
||||||
|
|
|
@ -67,6 +67,8 @@ class Manager(Loggable):
|
||||||
del(self.__wd_path[path])
|
del(self.__wd_path[path])
|
||||||
|
|
||||||
def __add_watch(self,path,listener):
|
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,
|
wd = self.wm.add_watch(path, pyinotify.ALL_EVENTS, rec=True,
|
||||||
auto_add=True, proc_fun=listener)
|
auto_add=True, proc_fun=listener)
|
||||||
self.__wd_path[path] = wd.values()[0]
|
self.__wd_path[path] = wd.values()[0]
|
||||||
|
|
Loading…
Reference in New Issue