def needsRecalculation(self): if not self.stdFile or not self.tmpFile: self.diag.info("No comparison, no recalculation") return False # A test that has been saved doesn't need recalculating if self.differenceCache == self.SAVED: self.diag.info("Saved file, no recalculation") return False stdModTime = plugins.modifiedTime(self.stdFile) if self.recalculationTime: self.diag.info("Already recalculated, checking if file updated since then : " + self.stdFile) # If we're already recalculated, only do it again if standard file changes since then return stdModTime > self.recalculationTime tmpModTime = plugins.modifiedTime(self.tmpFile) if stdModTime is not None and tmpModTime is not None and stdModTime >= tmpModTime: self.diag.info("Standard result newer than generated result at " + self.stdFile) return True if self.stdFile == self.stdCmpFile: # no filters return False stdCmpModTime = plugins.modifiedTime(self.stdCmpFile) self.diag.info("Comparing timestamps for standard files") return stdCmpModTime is not None and stdModTime is not None and stdModTime >= stdCmpModTime
def _updateRecordTime(self, file): newTime = plugins.modifiedTime(file) if newTime != self.recordTime: self.recordTime = newTime return True else: return False
def getFilesPresent(self, test): files = seqdict() for targetStem, sourcePatterns in self.collations.items(): for sourcePattern in sourcePatterns: for fullPath in self.findPaths(test, sourcePattern): self.diag.info("Pre-existing file found " + fullPath) files[fullPath] = plugins.modifiedTime(fullPath) return files
def getFilesPresent(self, test): files = OrderedDict() for sourcePatterns in test.getConfigValue("collate_file").values(): for sourcePattern in sourcePatterns: for fullPath in self.findPaths(test, sourcePattern): self.diag.info("Pre-existing file found " + fullPath) files[fullPath] = plugins.modifiedTime(fullPath) return files
def modifiedDate(self, file): if not file: return "---" modTime = plugins.modifiedTime(file) if modTime: return time.strftime("%d%b%H:%M:%S", time.localtime(modTime)) else: return "---"
def getEditInfo(self, fullPath): # Check modified times for files and directories, targets for links if os.path.islink(fullPath): return os.path.realpath(fullPath) else: return plugins.localtime(seconds=plugins.modifiedTime(fullPath))
def testEdited(self, test, fullPath): filesBefore = self.filesPresentBefore[test] if not filesBefore.has_key(fullPath): return True return filesBefore[fullPath] != plugins.modifiedTime(fullPath)
def getEditInfo(self, fullPath): # Check modified times for files and directories, targets for links if os.path.islink(fullPath): return os.path.realpath(fullPath) else: return time.strftime(plugins.datetimeFormat, time.localtime(plugins.modifiedTime(fullPath)))