コード例 #1
0
    def getHashInfo(self, intPath):
        '''
		Get the info-dict for internal item `intPath`
		'''
        if intPath not in self.hashedFiles:
            fp = self.open(intPath)
            cont = fp.read()
            ret = hf.getHashDict(intPath, cont)
            ret['cont'] = cont
            ret['type'] = fix_mime(magic.from_buffer(cont, mime=True))
            self.hashedFiles[intPath] = ret

        return self.hashedFiles[intPath]
コード例 #2
0
	def getHashInfo(self, intPath):
		'''
		Get the info-dict for internal item `intPath`
		'''
		if intPath not in self.hashedFiles:
			fp = self.open(intPath)
			cont = fp.read()
			ret = hf.getHashDict(intPath, cont)
			ret['cont'] = cont
			ret['type'] = fix_mime(magic.from_buffer(cont, mime=True))
			self.hashedFiles[intPath] = ret

		return self.hashedFiles[intPath]
コード例 #3
0
    def getHashInfo(self, intPath):
        """
		Get the info-dict for internal item `intPath`
		"""
        if intPath not in self.hashedFiles:
            fp = self.open(intPath)
            cont = fp.read()
            ret = hf.getHashDict(intPath, cont)
            ret["cont"] = cont
            ret["type"] = magic.from_buffer(cont)
            self.hashedFiles[intPath] = ret

        return self.hashedFiles[intPath]
コード例 #4
0
    def iterHashes(self):
        '''
		Iterate over all the files in the archive, and yield 2-tuples
		containing the internal-path and the internal-item-data as a dict
		'''
        items = list(self.getFileList())
        items.sort()
        for item in items:
            if item not in self.hashedFiles:
                fp = self.open(item)
                cont = fp.read()
                ret = hf.getHashDict(item, cont)
                ret['cont'] = cont
                ret['type'] = fix_mime(magic.from_buffer(cont, mime=True))
                self.hashedFiles[item] = ret
            yield item, self.hashedFiles[item]
コード例 #5
0
	def iterHashes(self):
		'''
		Iterate over all the files in the archive, and yield 2-tuples
		containing the internal-path and the internal-item-data as a dict
		'''
		items = list(self.getFileList())
		items.sort()
		for item in items:
			if item not in self.hashedFiles:
				fp = self.open(item)
				cont = fp.read()
				ret = hf.getHashDict(item, cont)
				ret['cont'] = cont
				ret['type'] = fix_mime(magic.from_buffer(cont, mime=True))
				self.hashedFiles[item] = ret
			yield item, self.hashedFiles[item]
コード例 #6
0
    def iterHashes(self):
        """
		Iterate over all the files in the archive, and yield 2-tuples
		containing the internal-path and the internal-item-data as a dict
		"""
        items = list(self.getFileList())
        items.sort()
        for item in items:
            if item not in self.hashedFiles:
                fp = self.open(item)
                cont = fp.read()
                ret = hf.getHashDict(item, cont)
                ret["cont"] = cont
                ret["type"] = magic.from_buffer(cont)
                self.hashedFiles[item] = ret
            yield item, self.hashedFiles[item]