def store_hashes_in_headers(headers):
        md5, sha1 = get_file_digests(
            filename,
            digests=(hashlib.md5(), hashlib.sha1()))

        headers[_HEADER_MD5_CHECKSUM] = md5.hexdigest()
        headers[_HEADER_SHA1_CHECKSUM] = sha1.hexdigest()
Ejemplo n.º 2
0
        def add_file_as_artifact(self, type, file):
            full_path = os.path.abspath(file)
            name = os.path.basename(full_path)

            md5, sha1 = get_file_digests(full_path,
                                         digests=(hashlib.md5(),
                                                  hashlib.sha1()))

            artifact = Artifact(type=type,
                                name=name,
                                sha1=sha1.hexdigest(),
                                md5=md5.hexdigest())

            self.ensure_artifacts_defined()
            self._artifacts.append(artifact)
Ejemplo n.º 3
0
        def add_file_as_artifact(self, type, file):
            full_path = os.path.abspath(file)
            name = os.path.basename(full_path)

            md5, sha1 = get_file_digests(
                full_path,
                digests=(hashlib.md5(), hashlib.sha1()))

            artifact = Artifact(
                type=type,
                name=name,
                sha1=sha1.hexdigest(),
                md5=md5.hexdigest())

            self.ensure_artifacts_defined()
            self._artifacts.append(artifact)
    def store_hashes_in_headers(headers):
        md5, sha1 = get_file_digests(filename,
                                     digests=(hashlib.md5(), hashlib.sha1()))

        headers[_HEADER_MD5_CHECKSUM] = md5.hexdigest()
        headers[_HEADER_SHA1_CHECKSUM] = sha1.hexdigest()