def has_changed(self): """Check wether the entry has changed using the following conditions: - cache file does not exist -> has changed - cache file does not contain required filter intermediate -> has changed - entry's file is newer than the cache's one -> has changed - otherwise -> not changed""" # with new-style classes we can't delete/overwrite @property-ied methods, # so we try to return a fixed value otherwise continue try: return self._has_changed except AttributeError: pass path = join(cache.cache_dir, self.md5) deps = [] for fxs in self.filters.iter(self.context): # extend filter dependencies deps.extend(fxs) if not cache.has_key(path, md5(*deps)): return True else: return self.lastmodified > cache.getmtime(path)
def has_changed(self): """Check wether the entry has changed using the following conditions: - cache file does not exist -> has changed - cache file does not contain required filter intermediate -> has changed - entry's file is newer than the cache's one -> has changed - otherwise -> not changed """ path = join(cache.cache_dir, self.md5) deps = [] for fxs in self.filters.iter(self.context): # extend filter dependencies deps.extend(fxs) if not cache.has_key(path, md5(*deps)): return True else: return getmtime(self.filename) > cache.getmtime(path)