Logo Search packages:      
Sourcecode: qa-assistant version File versions  Download package

def fedoraus::QAFunctions::_hash_directory (   self,
  directory,
  hasher 
) [private]

Get the cryptogaphic hash of all the files in the directory.

Attributes:
directory: The directory to hash the files of.
hasher: hash object to feed the file to.

Definition at line 279 of file fedoraus.py.

00279                                                 :
        '''Get the cryptogaphic hash of all the files in the directory.

        Attributes:
        directory: The directory to hash the files of.
        hasher: hash object to feed the file to.
        '''
        fileHashes = {}
        directories = []
        for filename in os.listdir(directory):
            srcFile = os.path.join(directory, filename)
            if (os.path.isdir(srcFile)):
                directories.append(filename)
                break
            myHasher = hasher.copy()
            fileHashes.update(self._hash_file(srcFile, myHasher))
            del myHasher

        if len(directories) > 0:
            raise QAError('Unexpected subdirectories', fileHashes)

        return fileHashes

    def _hash_file(self, filename, hasher):


Generated by  Doxygen 1.6.0   Back to index