def setup(self): self.s = Store() self.copy_images_over()
to work around watchdog picking up modified file paths at an indeterminate point in time, we maintain a counter of how many times to ignore it e.g. if we create a new file in a directory that watchdog is watching we can expect to receive 2 events, file_created and file_modified and increase its counter to 2 ''' counter = self.ignored[pth] if counter < 0: # ignore indefinitely return False elif counter > 0: self.ignored[pth] -= 1 return False # 0 default case return True store = Store() ########NEW FILE######## __FILENAME__ = context import sys, os sys.path.insert(0, os.path.abspath('../..')) import imagy reload(imagy) ########NEW FILE######## __FILENAME__ = imgtest from __future__ import division from path import path from subprocess import Popen, call