Exemple #1
0
 def getFilename(self, args):
     """Return a filename for a cached object corresponding to the provided args
        and this data type. This combines a hash of args with the name of this class.
        We create the cache directory if necessary.
        """
     hash = md5.md5(repr(args)).hexdigest()
     return Files.getCacheFile(self.__class__.__name__, hash)
Exemple #2
0
 def getFilename(self, args):
     """Return a filename for a cached object corresponding to the provided args
        and this data type. This combines a hash of args with the name of this class.
        We create the cache directory if necessary.
        """
     hash = md5.md5(repr(args)).hexdigest()
     return Files.getCacheFile(self.__class__.__name__, hash)
Exemple #3
0
 def getDiskPath(self):
     """Every target gets a directory on disk. This returns it, without any
        guarantee that it exists yet.
        """
     # XXX - Bear hack: store as stats/author/f/foobar for filesystem sanity
     segmentsLower = map(string.lower, self.pathSegments)
     if segmentsLower[0] == 'author' or segmentsLower[0] == 'project':
         target = segmentsLower[1]
         segmentsLower.insert(1, target[0])
     return Files.tryGetDir(Files.dbDir, 'stats', *segmentsLower)
Exemple #4
0
 def getTempFilename(self):
     """Return a suggested temporary file name for miss() to use"""
     return Files.getTempFile()
Exemple #5
0
 def getTempFilename(self):
     """Return a suggested temporary file name for miss() to use"""
     return Files.getTempFile()
Exemple #6
0
 def getDiskPath(self):
     """Every target gets a directory on disk. This returns it, without any
        guarantee that it exists yet.
        """
     return Files.tryGetDir(Files.dbDir, 'stats', *map(string.lower, self.pathSegments))