コード例 #1
0
    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
コード例 #2
0
 def _updateRecordTime(self, file):
     newTime = plugins.modifiedTime(file)
     if newTime != self.recordTime:
         self.recordTime = newTime
         return True
     else:
         return False
コード例 #3
0
ファイル: sandbox.py プロジェクト: haddyclipk/ICS
 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
コード例 #4
0
 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
コード例 #5
0
 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 "---"
コード例 #6
0
ファイル: sandbox.py プロジェクト: haddyclipk/ICS
 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))
コード例 #7
0
ファイル: sandbox.py プロジェクト: haddyclipk/ICS
 def testEdited(self, test, fullPath):
     filesBefore = self.filesPresentBefore[test]
     if not filesBefore.has_key(fullPath):
         return True
     return filesBefore[fullPath] != plugins.modifiedTime(fullPath)
コード例 #8
0
 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)))