Current File : //usr/lib/python3/dist-packages/s3transfer/__pycache__/__init__.cpython-312.pyc
�

��f�q���dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
mZddlmZddlZddlmZmZdZdZGd�d	ej0�Zej4e�Zej;e��d
Ze�Z d d�Z!d�Z"d
�Z#Gd�de$�Z%Gd�d�Z&Gd�d�Z'Gd�d�Z(Gd�d�Z)Gd�dejT�Z+Gd�d�Z,Gd�d�Z-Gd�d�Z.y)!a�Abstractions over S3's upload/download operations.

This module provides high level abstractions for efficient
uploads/downloads.  It handles several things for the user:

* Automatically switching to multipart transfers when
  a file is over a specific size threshold
* Uploading/downloading a file in parallel
* Throttling based on max bandwidth
* Progress callbacks to monitor transfers
* Retries.  While botocore handles retries for streaming uploads,
  it is not possible for it to handle retries for streaming
  downloads.  This module handles retries for both cases so
  you don't need to implement any retry logic yourself.

This module has a reasonable set of defaults.  It also allows you
to configure many aspects of the transfer process including:

* Multipart threshold size
* Max parallel downloads
* Max bandwidth
* Socket timeouts
* Retry amounts

There is no support for s3->s3 multipart copies at this
time.


.. _ref_s3transfer_usage:

Usage
=====

The simplest way to use this module is:

.. code-block:: python

    client = boto3.client('s3', 'us-west-2')
    transfer = S3Transfer(client)
    # Upload /tmp/myfile to s3://bucket/key
    transfer.upload_file('/tmp/myfile', 'bucket', 'key')

    # Download s3://bucket/key to /tmp/myfile
    transfer.download_file('bucket', 'key', '/tmp/myfile')

The ``upload_file`` and ``download_file`` methods also accept
``**kwargs``, which will be forwarded through to the corresponding
client operation.  Here are a few examples using ``upload_file``::

    # Making the object public
    transfer.upload_file('/tmp/myfile', 'bucket', 'key',
                         extra_args={'ACL': 'public-read'})

    # Setting metadata
    transfer.upload_file('/tmp/myfile', 'bucket', 'key',
                         extra_args={'Metadata': {'a': 'b', 'c': 'd'}})

    # Setting content type
    transfer.upload_file('/tmp/myfile.json', 'bucket', 'key',
                         extra_args={'ContentType': "application/json"})


The ``S3Transfer`` class also supports progress callbacks so you can
provide transfer progress to users.  Both the ``upload_file`` and
``download_file`` methods take an optional ``callback`` parameter.
Here's an example of how to print a simple progress percentage
to the user:

.. code-block:: python

    class ProgressPercentage(object):
        def __init__(self, filename):
            self._filename = filename
            self._size = float(os.path.getsize(filename))
            self._seen_so_far = 0
            self._lock = threading.Lock()

        def __call__(self, bytes_amount):
            # To simplify we'll assume this is hooked up
            # to a single filename.
            with self._lock:
                self._seen_so_far += bytes_amount
                percentage = (self._seen_so_far / self._size) * 100
                sys.stdout.write(
                    "
%s  %s / %s  (%.2f%%)" % (self._filename, self._seen_so_far,
                                                 self._size, percentage))
                sys.stdout.flush()


    transfer = S3Transfer(boto3.client('s3', 'us-west-2'))
    # Upload /tmp/myfile to s3://bucket/key and print upload progress.
    transfer.upload_file('/tmp/myfile', 'bucket', 'key',
                         callback=ProgressPercentage('/tmp/myfile'))



You can also provide a TransferConfig object to the S3Transfer
object that gives you more fine grained control over the
transfer.  For example:

.. code-block:: python

    client = boto3.client('s3', 'us-west-2')
    config = TransferConfig(
        multipart_threshold=8 * 1024 * 1024,
        max_concurrency=10,
        num_download_attempts=10,
    )
    transfer = S3Transfer(client, config)
    transfer.upload_file('/tmp/foo', 'bucket', 'key')


�N)�IncompleteReadError�ResponseStreamingError)�ReadTimeoutError)�RetriesExceededError�S3UploadFailedErrorzAmazon Web Servicesz0.10.1c��eZdZd�Zy)�NullHandlerc��y�N�)�self�records  �5/usr/lib/python3/dist-packages/s3transfer/__init__.py�emitzNullHandler.emit�s���N)�__name__�
__module__�__qualname__rrrrr	r	�s��
rr	ic�D�djd�t|�D��S)N�c3�bK�|]'}tjtj����)y�wr)�random�choice�string�	hexdigits)�.0�_s  r�	<genexpr>z(random_file_extension.<locals>.<genexpr>�s����N�q�6�=�=��!1�!1�2�N�s�-/)�join�range)�
num_digitss r�random_file_extensionr"�s��
�7�7�N�E�*�<M�N�N�Nrc�p�|dvr2t|jd�r|jj�yyy)N��	PutObject�
UploadPart�disable_callback)�hasattr�bodyr'��request�operation_name�kwargss   r�disable_upload_callbacksr.�s6���4�4�����(�:�	���%�%�'�:�4rc�p�|dvr2t|jd�r|jj�yyy)Nr$�enable_callback)r(r)r0r*s   r�enable_upload_callbacksr1�s6���4�4�����'�:�	���$�$�&�:�4rc��eZdZy)�QueueShutdownErrorN)rrrrrrr3r3�s��rr3c�r�eZdZ		dd�Ze		dd��Zd�Zdd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zy)�
ReadFileChunkNc���||_||_|j|j|||��|_|jj	|j�d|_||_||_y)a�

        Given a file object shown below:

            |___________________________________________________|
            0          |                 |                 full_file_size
                       |----chunk_size---|
                 start_byte

        :type fileobj: file
        :param fileobj: File like object

        :type start_byte: int
        :param start_byte: The first byte from which to start reading.

        :type chunk_size: int
        :param chunk_size: The max chunk size to read.  Trying to read
            pass the end of the chunk size will behave like you've
            reached the end of the file.

        :type full_file_size: int
        :param full_file_size: The entire content length associated
            with ``fileobj``.

        :type callback: function(amount_read)
        :param callback: Called whenever data is read from this object.

        )�requested_size�
start_byte�actual_file_sizerN)�_fileobj�_start_byte�_calculate_file_size�_size�seek�_amount_read�	_callback�_callback_enabled)r
�fileobjr8�
chunk_size�full_file_size�callbackr0s       r�__init__zReadFileChunk.__init__�sl��J ��
�%����.�.��M�M�%�!�+�	/�
��
�	
�
�
���4�+�+�,����!���!0��rc��t|d�}tj|j��j}|||||||�S)aWConvenience factory function to create from a filename.

        :type start_byte: int
        :param start_byte: The first byte from which to start reading.

        :type chunk_size: int
        :param chunk_size: The max chunk size to read.  Trying to read
            pass the end of the chunk size will behave like you've
            reached the end of the file.

        :type full_file_size: int
        :param full_file_size: The entire content length associated
            with ``fileobj``.

        :type callback: function(amount_read)
        :param callback: Called whenever data is read from this object.

        :type enable_callback: bool
        :param enable_callback: Indicate whether to invoke callback
            during read() calls.

        :rtype: ``ReadFileChunk``
        :return: A new instance of ``ReadFileChunk``

        �rb)�open�os�fstat�fileno�st_size)�cls�filenamer8rCrEr0�f�	file_sizes        r�
from_filenamezReadFileChunk.from_filename�sE��D
��4� ���H�H�Q�X�X�Z�(�0�0�	��
�z�:�y�(�O�
�	
rc�$�||z
}t||�Sr)�min)r
rBr7r8r9�max_chunk_sizes      rr<z"ReadFileChunk._calculate_file_sizes��*�J�6���>�>�2�2rc�Z�|�|j|jz
}n#t|j|jz
|�}|jj	|�}|xjt|�z
c_|j�&|jr|j
t|��|Sr)r=r?rTr:�read�lenr@rA)r
�amount�amount_to_read�datas    rrWzReadFileChunk.reads����>�!�Z�Z�$�*;�*;�;�N� ����d�.?�.?�!?��H�N��}�}�!�!�.�1�����S��Y�&���>�>�%�$�*@�*@��N�N�3�t�9�%��rc��d|_y�NT�rA�r
s rr0zReadFileChunk.enable_callback#s
��!%��rc��d|_y�NFr^r_s rr'zReadFileChunk.disable_callback&s
��!&��rc���|jj|j|z�|j�*|jr|j||j
z
�||_yr)r:r>r;r@rAr?)r
�wheres  rr>zReadFileChunk.seek)sP���
�
���4�+�+�e�3�4��>�>�%�$�*@�*@��N�N�5�4�#4�#4�4�5�!��rc�8�|jj�yr)r:�closer_s rrezReadFileChunk.close0s���
�
���rc��|jSr)r?r_s r�tellzReadFileChunk.tell3s��� � � rc��|jSr)r=r_s r�__len__zReadFileChunk.__len__6s���z�z�rc��|Srrr_s r�	__enter__zReadFileChunk.__enter__>s���rc�$�|j�yr)re)r
�argsr-s   r�__exit__zReadFileChunk.__exit__As���
�
�rc��tg�Sr)�iterr_s r�__iter__zReadFileChunk.__iter__Ds
���B�x�rr]r)rrrrF�classmethodrRr<rWr0r'r>rergrirkrnrqrrrr5r5�sd����01�d���
%
��%
�N3�	�&�'�"��!����rr5c��eZdZdZdd�Zd�Zy)�StreamReaderProgressz<Wrapper for a read only stream that adds progress callbacks.Nc� �||_||_yr)�_streamr@)r
�streamrEs   rrFzStreamReaderProgress.__init__Ps�����!��rc��|jj|i|��}|j�|jt|��|Sr)rvrWr@rX)r
rmr-�values    rrWzStreamReaderProgress.readTs<��!����!�!�4�2�6�2���>�>�%��N�N�3�u�:�&��rr)rrr�__doc__rFrWrrrrtrtMs��F�"�rrtc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�OSUtilsc�@�tjj|�Sr)rJ�path�getsize�r
rOs  r�
get_file_sizezOSUtils.get_file_size\s���w�w���x�(�(rc�6�tj||||d��S)NF)r0)r5rR)r
rOr8�sizerEs     r�open_file_chunk_readerzOSUtils.open_file_chunk_reader_s%���*�*��j�$��%�+�
�	
rc��t||�Sr)rI)r
rO�modes   rrIzOSUtils.opends���H�d�#�#rc�N�	tj|�y#t$rYywxYw)z+Remove a file, noop if file does not exist.N)rJ�remove�OSErrorr�s  r�remove_filezOSUtils.remove_filegs%��	��I�I�h����	��	�s��	$�$c�D�tjj||�yr)�
s3transfer�compat�rename_file)r
�current_filename�new_filenames   rr�zOSUtils.rename_fileps�����%�%�&6��ErN)rrrr�r�rIr�r�rrrr|r|[s��)�
�
$��Frr|c�^�eZdZgd�Zej
jfd�Zd�Zd�Z	d�Z
d�Zy)�MultipartUploader)�SSECustomerKey�SSECustomerAlgorithm�SSECustomerKeyMD5�RequestPayerc�<�||_||_||_||_yr)�_client�_config�_os�
_executor_cls�r
�client�config�osutil�executor_clss     rrFzMultipartUploader.__init__~s!�����������)��rc�b�i}|j�D]\}}||jvs�|||<�|Sr)�items�UPLOAD_PART_ARGS)r
�
extra_args�upload_parts_args�keyrys     r�_extra_upload_part_argsz)MultipartUploader._extra_upload_part_args�sG����$�*�*�,�	/�J�C���d�+�+�+�).�!�#�&�	/�!� rc
��|jjd||d�|��}|d}	|j||||||�}|jj|||d	|i�
�y#t$rg}	tjdd��|jj
|||��tdj|dj||g�|	���d}	~	wwxYw)N��Bucket�Key�UploadIdzBException raised while uploading parts, aborting multipart upload.T��exc_info)r�r�r�zFailed to upload {} to {}: {}�/�Parts)r�r�r��MultipartUploadr)r��create_multipart_upload�
_upload_parts�	Exception�logger�debug�abort_multipart_uploadr�formatr�complete_multipart_upload)
r
rO�bucketr�rEr��response�	upload_id�parts�es
          r�upload_filezMultipartUploader.upload_file�s���7�4�<�<�7�7�
��s�
�&0�
���Z�(�	�	��&�&��8�V�S�(�J��E�"	
���.�.����$�e�,�		/�	
���
	��L�L�-��
�
�

�L�L�/�/��3��
0�
�&�/�6�6��c�h�h���}�5�q���
��
	�s�A�	C�'A"C	�	Cc��|j|�}g}|jj}	tt	j
|jj|�t|	�z��}
|jj}|j|��5}tj|j|||||	||�}
|j|
td|
dz��D]}|j!|��	ddd�|S#1swY|SxYw)N��max_workers�)r�r��multipart_chunksize�int�math�ceilr�r��float�max_concurrencyr��	functools�partial�_upload_one_part�mapr �append)r
r�rOr�r�rEr��upload_parts_extra_argsr��	part_size�	num_partsr��executor�upload_partial�parts               rr�zMultipartUploader._upload_parts�s���#'�">�">�z�"J�����L�L�4�4�	���I�I�d�h�h�,�,�X�6��y�9I�I�J�
�	��l�l�2�2��
�
�
�K�
�
8�	#�H�&�.�.��%�%������'��	�N�!���^�U�1�i�!�m�5L�M�
#�����T�"�
#�	#���	#���s
�AC<�<Dc	
���|jj}	|	|||dz
z||�5}
|jjd|||||
d�|��}|d}||d�cddd�S#1swYyxYw)Nr�)r�r�r��
PartNumber�Body�ETag)r�r�r)r�r�r��upload_part)
r
rOr�r�r�r�r�rE�part_number�open_chunk_readerr)r��etags
             rr�z"MultipartUploader._upload_one_part�s���!�H�H�;�;��
��i�;��?�3�Y��
�	=�
�/�t�|�|�/�/����"�&����
�H��F�#�D� ��<�	=�	=�	=�s�,A�A'N)rrrr��
concurrent�futures�ThreadPoolExecutorrFr�r�r�r�rrrr�r�ts4���� �'�'�:�:�
*�!�
�<�2=rr�c�"�eZdZdZd�Zd�Zd�Zy)�
ShutdownQueueaYA queue implementation that can be shutdown.

    Shutting down a queue means that this class adds a
    trigger_shutdown method that will trigger all subsequent
    calls to put() to fail with a ``QueueShutdownError``.

    It purposefully deviates from queue.Queue, and is *not* meant
    to be a drop in replacement for ``queue.Queue``.

    c��d|_tj�|_tj
j
||�Sra)�	_shutdown�	threading�Lock�_shutdown_lock�queue�Queue�_init)r
�maxsizes  rr�zShutdownQueue._init�s/�����'�n�n�.����{�{� � ��w�/�/rc�~�|j5d|_tjd�ddd�y#1swYyxYw)NTzThe IO queue is now shutdown.)r�r�r�r�r_s r�trigger_shutdownzShutdownQueue.trigger_shutdown�s4��
�
 �
 �	:�!�D�N��L�L�8�9�	:�	:�	:�s�3�<c��|j5|jrtd��	ddd�tjj||�S#1swY�)xYw)Nz6Cannot put item to queue when queue has been shutdown.)r�r�r3r�r��put)r
�items  rr�zShutdownQueue.put�sU���
 �
 �	��~�~�(�O����	�
�{�{���t�T�*�*�	�	�s�A�AN)rrrrzr�r�r�rrrr�r��s��	�0�:�
+rr�c�f�eZdZejj
fd�Z	d	d�Zd�Zd�Z	d�Z
d�Zd�Zy)
�MultipartDownloaderc��||_||_||_||_t	|jj
�|_yr)r�r�r�r�r��max_io_queue�_ioqueuer�s     rrFzMultipartDownloader.__init__s7�����������)���%�d�l�l�&?�&?�@��
rNc	��|jd��5}tj|j|||||�}|j	|�}	tj|j
|�}
|j	|
�}tjj|	|gtjj��}|j|�ddd�y#1swYyxYw)N�r�)�return_when)r�r�r��_download_file_as_future�submit�_perform_io_writesr�r��wait�FIRST_EXCEPTION�_process_future_results)
r
r�r�rO�object_sizer�rE�
controller�download_parts_handler�parts_future�io_writes_handler�	io_future�resultss
             r�
download_filez!MultipartDownloader.download_files����
�
�A�
�
.�	2�*�&/�%6�%6��-�-������
&�"�&�,�,�-C�D�L� )� 1� 1��'�'��!��#�)�)�*;�<�I� �(�(�-�-��y�)�&�.�.�>�>�.��G�
�(�(��1�+	2�	2�	2�s�B3C�Cc�<�|\}}|D]}|j��yr)�result)r
r��finished�
unfinished�futures     rr�z+MultipartDownloader._process_future_results/s$��&���*��	�F��M�M�O�	rc	��|jj}ttj|t|�z��}|jj}tj|j||||||�}		|j|��5}
t|
j|	t|���ddd�|jjt �y#1swY�)xYw#|jjt �wxYw)Nr�)r�r�r�r�r�r�r�r�r��_download_ranger��listr�r r�r��SHUTDOWN_SENTINEL)r
r�r�rOr�rEr�r�r��download_partialr�s           rr�z,MultipartDownloader._download_file_as_future4s����L�L�4�4�	���	�	�+��i�0@�"@�A�B�	��l�l�2�2��$�,�,�� � �������
��	1��#�#��#�<�
G���X�\�\�"2�E�)�4D�E�F�
G�
�M�M���/�0�
G�
G��
�M�M���/�0�s$�=C(�%C�4C(�C%�!C(�(!D	c�F�||z}||dz
k(rd}n||zdz
}d|�d|��}|S)Nr�rzbytes=�-r)r
r��
part_indexr��start_range�	end_range�range_params       r�_calculate_range_paramz*MultipartDownloader._calculate_range_paramIsD�� �9�,����Q��&��I�#�i�/�!�3�I��{�m�1�Y�K�8���rc	����	|j|||�}|jj}	d}
t|	�D]�}	tjd�|jj|||��}t|d|��d�||z}
t��fd�d�D]-}|jj|
|f�|
t|�z
}
�/tjd|�yt'|
��#tjtt t"t$f$r&}tjd|||	d	�
�|}
Yd}~��d}~wwxYw#tjd|�wxYw)NzMaking get_object call.)r�r��Ranger�i@c�&���j��Sr�rW)�buffer_size�streaming_bodys��r�<lambda>z5MultipartDownloader._download_range.<locals>.<lambda>hs���� 3� 3�K� @�rrz$EXITING _download_range for part: %s�CRetrying exception caught (%s), retrying request, (attempt %s / %s)Tr�)rr��num_download_attemptsr r�r�r��
get_objectrtrpr�r�rX�socket�timeoutr�rrrr)r
r�r�rOr�r�rErr�max_attempts�last_exception�ir��
current_index�chunkr�rrs                @@rrz#MultipartDownloader._download_rangeRso���+	M��5�5��:�y��K� �<�<�=�=�L�!�N��<�(�!
�� ��L�L�!:�;�#�|�|�6�6�%�3�k� 7� �H�&:� ��(�(�&�N�#,�K�$-�
�$:�M�!%�@�#�"�4���
�
�)�)�=�%�*@�A�%��U��3�
�	4�
�(
�L�L�?��L�I!
�D'�~�6�6��!�N�N��$�'�*����L�L�>���$�!%�
!��&'�N���!��&
�L�L�?��L�s;�9D<�B	C+�D<�D<�+(D9�D4�/D<�4D9�9D<�<Ec��|jj|d�5}	|jj�}|turt
j
d�	ddd�y	|\}}|j|�|j|��j#t$r8}t
j
d|d��|jj��d}~wwxYw#1swYyxYw)N�wbTzCShutdown sentinel received in IO handler, shutting down IO handler.z!Caught exception in IO thread: %sr�)r�rIr��getrr�r�r>�writer�r�)r
rOrP�task�offsetr[r�s       rr�z&MultipartDownloader._perform_io_writes�s���
�X�X�]�]�8�T�
*�	�a���}�}�(�(�*���,�,��L�L�4���	�	��'+�������v������
���%�����?��%)�%��
�
�
�6�6�8�����	�	�s/�:C
�!'B	�C
�		C
�3C�C
�
C
�
Cr)
rrrr�r�r�rFrr�r�rrr�rrrr�r�s@�� �'�'�:�:�A�HL�2�4�
1�*�.M�`rr�c�*�eZdZdezddezddfd�Zy)�TransferConfig��
��dc�J�||_||_||_||_||_yr)�multipart_thresholdr�r�rr�)r
r5r�r�rr�s      rrFzTransferConfig.__init__�s,��$7�� �.���#6�� �%:��"�(��rN)rrr�MBrFrrrr/r/�s ����F����F���
)rr/c�h�eZdZgd�Zgd�Zdd�Z	dd�Zd�Z	dd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zy)�
S3Transfer)�	VersionIdr�r�r�r�)�ACL�CacheControl�ContentDisposition�ContentEncoding�ContentLanguage�ContentType�Expires�GrantFullControl�	GrantRead�GrantReadACP�
GrantWriteACL�Metadatar��ServerSideEncryption�StorageClassr�r�r��SSEKMSKeyId�SSEKMSEncryptionContext�TaggingNc�^�||_|�
t�}||_|�
t�}||_yr)r�r/r�r|�_osutil)r
r�r�r�s    rrFzS3Transfer.__init__�s0������>�#�%�F�����>��Y�F���rc��|�i}|j||j�|jjj}|jdtd��|jdtd��|jj|�|jjk\r|j|||||�y|j|||||�y)z�Upload a file to an S3 object.

        Variants have also been injected into S3 client, Bucket and Object.
        You don't have to use S3Transfer.upload_file() directly.
        Nzrequest-created.s3zs3upload-callback-disable)�	unique_idzs3upload-callback-enable)�_validate_all_known_args�ALLOWED_UPLOAD_ARGSr��meta�events�register_firstr.�
register_lastr1rLr�r�r5�_multipart_upload�_put_object)r
rOr�r�rEr�rRs       rr�zS3Transfer.upload_file�s������J��%�%�j�$�2J�2J�K����"�"�)�)����� �$�1�	�	
�
	��� �#�0�	�	
�
�L�L�&�&�x�0��|�|�/�/�
0�
�"�"�8�V�S�(�J�O����X�v�s�H�j�Irc���|jj}||d|jj|�|��5}|jjd|||d�|��ddd�y#1swYyxYw)Nr)rE)r�r�r�r)rLr�r�r��
put_object)r
rOr�r�rEr�r�r)s        rrVzS3Transfer._put_object�sy��!�L�L�?�?��
��
��L�L�&�&�x�0��	
�	�
�#�D�L�L�#�#�
��3�T�
�5?�
�
	�	�	�s�!A&�&A/c��|�i}|j||j�|j|||�}|tjzt�z}	|j
||||||�|jj||�y#t$r5tjd|d��|jj|��wxYw)z�Download an S3 object to a file.

        Variants have also been injected into S3 client, Bucket and Object.
        You don't have to use S3Transfer.download_file() directly.
        Nz<Exception caught in download_file, removing partial file: %sTr�)
rO�ALLOWED_DOWNLOAD_ARGS�_object_sizerJ�extsepr"�_download_filerLr�r�r�r�r�)r
r�r�rOr�rEr��
temp_filenames        rrzS3Transfer.download_files������J��%�%�j�$�2L�2L�M��'�'���Z�@�� �2�9�9�,�/D�/F�F�
�	>������]�K��X�
�
�L�L�$�$�]�H�=���	��L�L����	
�
�
�L�L�$�$�]�3��	�s�B�>Cc��||jjk\r|j||||||�y|j|||||�yr)r�r5�_ranged_download�_get_object)r
r�r�rOr�r�rEs       rr]zS3Transfer._download_file!sI���$�,�,�:�:�:��!�!���X�{�J��
�
���V�S�(�J��Irc	�Z�|D]&}||vs�td|�ddj|�����y)NzInvalid extra_args key 'z', must be one of: z, )�
ValueErrorr)r
�actual�allowed�kwargs    rrOz#S3Transfer._validate_all_known_args+s:���	�E��G�#� �,1�4�9�9�W�3E�G���	rc��t|j|j|j�}|j	||||||�yr)r�r�r�rLr)r
r�r�rOr�r�rE�
downloaders        rr`zS3Transfer._ranged_download3s>��)��L�L�$�,�,����
�
�	� � ��C��;�
�H�	
rc	�8�|jj}d}t|�D]}	|j|||||�cSt|��#tj
ttttf$r&}	tjd|	||d��|	}Yd}	~	�pd}	~	wwxYw)NrTr�)
r�rr �_do_get_objectr!r"r�rrrr�r�r)
r
r�r�rOr�rEr#r$r%r�s
          rrazS3Transfer._get_object=s����|�|�9�9�����|�$�	�A�
��*�*��C��:�x���	�0#�>�2�2��%���� �#�&��
����:��� �!�
��"#����%
�s�A�(B�3B�Bc��	�|jjd||d�|��}t|d|��	|jj	|d�5}t�	fd�d�D]}|j
|��	ddd�y#1swYyxYw)Nr�r�r)c�&���jd�S)Ni r)rs�rrz+S3Transfer._do_get_object.<locals>.<lambda>as���n�&9�&9�$�&?�rrr)r�r rtrLrIrpr+)
r
r�r�rOr�rEr�rPr'rs
         @rrjzS3Transfer._do_get_object[s����*�4�<�<�*�*�
��s�
�&0�
��.�h�v�.>��I��
�\�\�
�
�x��
.�	�!��?��E�
�������
�	�	�	�s�&A<�<Bc�F�|jjd||d�|��dS)Nr��
ContentLengthr)r��head_object)r
r�r�r�s    rr[zS3Transfer._object_sizeds-��'�t�|�|�'�'�M�v�3�M�*�M��
�	
rc��t|j|j|j�}|j	|||||�yr)r�r�r�rLr�)r
rOr�r�rEr��uploaders       rrUzS3Transfer._multipart_uploadis2��$�T�\�\�4�<�<����N�����X�v�s�H�j�Ir)NN)rrrrZrPrFr�rVrr]rOr`rarjr[rUrrrr8r8�s[������0�@D�J�<�@D�>�@J��
�3�<�
�
Jrr8)r0)/rz�concurrent.futuresr�r��loggingr�rJr�rr!rr��botocore.exceptionsrr�urllib3.exceptionsr�s3transfer.compatr��s3transfer.exceptionsrr�
__author__�__version__�Handlerr	�	getLoggerrr��
addHandlerr6�objectrr"r.r1r�r3r5rtr|r�r�r�r�r/r8rrr�<module>r~s	��p�b����	��
�
�
��K���K�
"�
���
�'�/�/�
�

��	�	�8�	$�����+�-� ����H��O�(�'�	��	�S�S�l��F�F�2n=�n=�b+�E�K�K�+�DQ�Q�h
)�
)� @J�@Jr
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!