https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/boto/glacier/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/glacier/__pycache__/job.cpython-310.pyc
o

ckF[?�@s@ddlZddlZddlmZmZddlmZGdd�de�ZdS)�N)�TreeHashDoesNotMatchError�DownloadArchiveError)�tree_hash_from_strc@speZdZdZdZddd�Zdd�Zdd	d
�Zdd�Zed
e	j
ffdd�Zed
e	j
ffdd�Zdd�Z
dd�ZdS)�Jobi@))�Action�actionN)�	ArchiveId�
archive_idN)�ArchiveSizeInBytes�archive_sizer)�	Completed�	completedF)�CompletionDate�completion_dateN)�CreationDate�
creation_dateN)�InventorySizeInBytes�inventory_sizer)�JobDescription�descriptionN)�JobId�idN)�SHA256TreeHash�sha256_treehashN)�SNSTopic�	sns_topicN)�
StatusCode�status_codeN)�
StatusMessage�status_messageN)�VaultARN�arnNNcCsR||_|r|jD]
\}}}t||||�qdS|jD]\}}}t|||�qdS�N)�vault�ResponseDataElements�setattr)�selfr#�
response_data�
response_name�	attr_name�default�r+�2/usr/lib/python3/dist-packages/boto/glacier/job.py�__init__2s��zJob.__init__cCs
d|jS)NzJob(%s))r!)r&r+r+r,�__repr__;s
zJob.__repr__FcCsZ|jj�|jj|j|�}|r+d|vr+|��}t|�}|d|kr+td||d|f��|S)a&
        This operation downloads the output of the job.  Depending on
        the job type you specified when you initiated the job, the
        output will be either the content of an archive or a vault
        inventory.

        You can download all the job output or download a portion of
        the output by specifying a byte range. In the case of an
        archive retrieval job, depending on the byte range you
        specify, Amazon Glacier returns the checksum for the portion
        of the data. You can compute the checksum on the client and
        verify that the values match to ensure the portion you
        downloaded is the correct data.

        :type byte_range: tuple
        :param range: A tuple of integer specifying the slice (in bytes)
            of the archive you want to receive

        :type validate_checksum: bool
        :param validate_checksum: Specify whether or not to validate
            the associate tree hash.  If the response does not contain
            a TreeHash, then no checksum will be verified.

        �TreeHash�ZThe calculated tree hash %s does not match the expected tree hash %s for the byte range %s)r#�layer1�get_job_output�namer�readrr)r&�
byte_range�validate_checksum�response�data�actual_tree_hashr+r+r,�
get_output>s�
���zJob.get_outputcCstt�|jt|���Sr")�int�math�ceilr�float)r&�
chunk_sizer+r+r,�_calc_num_chunksdszJob._calc_num_chunksTcCsL|�|�}t|d��}|�|||||�Wd�dS1swYdS)a�Download an archive to a file by name.

        :type filename: str
        :param filename: The name of the file where the archive
            contents will be saved.

        :type chunk_size: int
        :param chunk_size: The chunk size to use when downloading
            the archive.

        :type verify_hashes: bool
        :param verify_hashes: Indicates whether or not to verify
            the tree hashes for each downloaded chunk.

        �wbN)r@�open�_download_to_fileob)r&�filenamer?�
verify_hashes�retry_exceptions�
num_chunks�output_filer+r+r,�download_to_filegs

�"�zJob.download_to_filecCs |�|�}|�|||||�dS)a�Download an archive to a file object.

        :type output_file: file
        :param output_file: The file object where the archive
            contents will be saved.

        :type chunk_size: int
        :param chunk_size: The chunk size to use when downloading
            the archive.

        :type verify_hashes: bool
        :param verify_hashes: Indicates whether or not to verify
            the tree hashes for each downloaded chunk.

        N)r@rC)r&rHr?rErFrGr+r+r,�download_to_fileobj}s

�zJob.download_to_fileobjcCsjt|�D].}|||d|df}|�||�\}}	|r-t|�}
|	|
kr-td|
|	|f��|�|�qdS)N�r0)�range�_download_byte_rangerr�write)r&�fileobjrGr?rErF�ir5r8�expected_tree_hashr9r+r+r,rC�s �����zJob._download_to_fileobcCsjtd�D](}z|�|�}|��}|d}||fWS|y,}zWYd}~qd}~wwtd||f��)N�r/z/There was an error downloadingbyte range %s: %s)rLr:r4r)r&r5rF�_r7r8rQ�er+r+r,rM�s
����zJob._download_byte_ranger")NF)�__name__�
__module__�__qualname__�DefaultPartSizer$r-r.r:r@�socket�errorrIrJrCrMr+r+r+r,rs 
	
&
�
�r)	r<rY�boto.glacier.exceptionsrr�boto.glacier.utilsr�objectrr+r+r+r,�<module>s


https://t.me/RX1948 - 2025