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

�<�e�l���ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
mZddlmZddlmZddlmZmZmZdZdZd	Zej4e�Zej:ee
eefZd)d
�Zd�Z d�Z!d
�Z"	d*d�Z#d�Z$d�Z%d�Z&Gd�d�Z'Gd�d�Z(Gd�d�Z)Gd�d�Z*Gd�d�Z+Gd�d�Z,Gd�d�Z-Gd �d!e.�Z/Gd"�d#�Z0Gd$�d%e0�Z1Gd&�d'�Z2d(�Z3y)+�N)�defaultdict)�IncompleteReadError�ReadTimeoutError�ResponseStreamingError)�AwsChunkedWrapper��is_s3express_bucket)�SOCKET_ERROR�	fallocate�rename_filei'liPc�D�djd�t|�D��S)N�c3�bK�|]'}tjtj����)y�w�N)�random�choice�string�	hexdigits)�.0�_s  �2/usr/lib/python3/dist-packages/s3transfer/utils.py�	<genexpr>z(random_file_extension.<locals>.<genexpr>5s����N�q�6�=�=��!1�!1�2�N�s�-/)�join�range)�
num_digitss r�random_file_extensionr4s��
�7�7�N�E�*�<M�N�N�N�c�p�|dvr2t|jd�r|jj�yyy)N��	PutObject�
UploadPart�signal_not_transferring)�hasattr�bodyr")�request�operation_name�kwargss   rr"r"8s6���4�4�����/�:�	���,�,�.�:�4rc��|dvrG|j}t|t�r
t|dd�}t	|d�r|j�yyy)Nr�_raw�signal_transferring)r$�
isinstancer�getattrr#r*)r%r&r'r$s    rr*r*?sN���4�4��|�|���d�-�.��4���.�D��4�.�/��$�$�&�0�	5rc�V�ttj|t|�z��Sr)�int�math�ceil�float)�size�	part_sizes  r�calculate_num_partsr4Hs ���t�y�y���i� 0�0�1�2�2rc�f�||z}||dz
k(rd}|�t|dz
�}n||zdz
}d|�d|��}|S)a�Calculate the range parameter for multipart downloads/copies

    :type part_size: int
    :param part_size: The size of the part

    :type part_index: int
    :param part_index: The index for which this parts starts. This index starts
        at zero

    :type num_parts: int
    :param num_parts: The total number of parts in the transfer

    :returns: The value to use for Range parameter on downloads or
        the CopySourceRange parameter for copies
    �rzbytes=�-)�str)r3�
part_index�	num_parts�
total_size�start_range�	end_range�range_params       r�calculate_range_parameterr?LsZ��&�y�(�K��Y��]�"��	��!��J��N�+�I��)�+�a�/�	��;�-�q���4�K��rc	���g}|jjjD]D}d|z}t||�s�|j	tjt||�|����F|S)aRetrieves callbacks from a subscriber

    :type transfer_future: s3transfer.futures.TransferFuture
    :param transfer_future: The transfer future the subscriber is associated
        to.

    :type callback_type: str
    :param callback_type: The type of callback to retrieve from the subscriber.
        Valid types include:
            * 'queued'
            * 'progress'
            * 'done'

    :returns: A list of callbacks for the type specified. All callbacks are
        preinjected with the transfer future.
    �on_)�future)�meta�	call_args�subscribersr#�append�	functools�partialr,)�transfer_future�
callback_type�	callbacks�
subscriber�
callback_names     r�
get_callbacksrNjsn��"�I�%�*�*�4�4�@�@��
��
�-�
��:�}�-�����!�!��J�
�6���
���rc�*�|r|D]}||���
yy)a�Calls all progress callbacks

    :param callbacks: A list of progress callbacks to invoke
    :param bytes_transferred: The number of bytes transferred. This is passed
        to the callbacks. If no bytes were transferred the callbacks will not
        be invoked because no progress was achieved. It is also possible
        to receive a negative amount which comes from retrying a transfer
        request.
    ��bytes_transferredN�)rKrQ�callbacks   r�invoke_progress_callbacksrT�s$���!�	:�H��'8�9�	:�rc�N�i}|j�D]\}}||vs�|||<�|S)aoGets a dictionary filtered by whitelisted keys

    :param original_dict: The original dictionary of arguments to source keys
        and values.
    :param whitelisted_key: A list of keys to include in the filtered
        dictionary.

    :returns: A dictionary containing key/values from the original dictionary
        whose key was included in the whitelist
    )�items)�
original_dict�whitelisted_keys�
filtered_dict�key�values     r�get_filtered_dictr\�s@���M�#�)�)�+�'�
��U��"�"�!&�M�#��'��rc��eZdZd�Zy)�CallArgsc�N�|j�D]\}}t|||��y)z�A class that records call arguments

        The call arguments must be passed as keyword arguments. It will set
        each keyword argument as an attribute of the object along with its
        associated value.
        N)rV�setattr)�selfr'�argr[s    r�__init__zCallArgs.__init__�s)��!�,�,�.�	&�J�C���D�#�u�%�	&rN)�__name__�
__module__�__qualname__rcrRrrr^r^�s��&rr^c�"�eZdZdZd�Zd�Zd�Zy)�FunctionContainerz�An object that contains a function and any args or kwargs to call it

    When called the provided function will be called with provided args
    and kwargs.
    c�.�||_||_||_yr��_func�_args�_kwargs)ra�func�argsr's    rrczFunctionContainer.__init__�s����
���
���rc�d�dj|j|j|j�S)Nz'Function: {} with args {} and kwargs {})�formatrkrlrm�ras r�__repr__zFunctionContainer.__repr__�s(��8�?�?��J�J��
�
�D�L�L�
�	
rc�N�|j|ji|j��Srrjrrs r�__call__zFunctionContainer.__call__�s ���t�z�z�4�:�:�6����6�6rN)rdrerf�__doc__rcrsrurRrrrhrh�s����

�
7rrhc�8�eZdZdZd�Zed��Zd�Zd�Zd�Z	y)�CountCallbackInvokerz�An abstraction to invoke a callback when a shared count reaches zero

    :param callback: Callback invoke when finalized count reaches zero
    c�`�tj�|_||_d|_d|_y)NrF)�	threading�Lock�_lock�	_callback�_count�
_is_finalized�rarSs  rrczCountCallbackInvoker.__init__�s&���^�^�%��
�!������"��rc�^�|j5|jcddd�S#1swYyxYwr�r|r~rrs r�
current_countz"CountCallbackInvoker.current_count�s%��
�Z�Z�	��;�;�	�	�	���#�,c��|j5|jrtd��|xjdz
c_ddd�y#1swYyxYw)zIncrement the count by onez;Counter has been finalized it can no longer be incremented.r6N)r|r�RuntimeErrorr~rrs r�	incrementzCountCallbackInvoker.increment�sI��
�Z�Z�	��!�!�"�#���
�K�K�1��K�
	�	�	�s�-A�Ac��|j5|jdk(rtd��|xjdzc_|jr|jdk(r|j	�ddd�y#1swYyxYw)zDecrement the count by onerz,Counter is at zero. It cannot dip below zeror6N)r|r~r�rr}rrs r�	decrementzCountCallbackInvoker.decrement�sh��
�Z�Z�	!��{�{�a��"�B���
�K�K�1��K��!�!�d�k�k�Q�&6���� �	!�	!�	!�s�AA1�1A:c��|j5d|_|jdk(r|j�ddd�y#1swYyxYw)z�Finalize the counter

        Once finalized, the counter never be incremented and the callback
        can be invoked once the count reaches zero
        TrN)r|rr~r}rrs r�finalizezCountCallbackInvoker.finalize�s>���Z�Z�	!�!%�D���{�{�a����� �	!�	!�	!�s	�'=�AN)
rdrerfrvrc�propertyr�r�r�r�rRrrrxrx�s/���
#������	!�	!rrxc�J�eZdZdZd�Zd�Z	dd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zy)
�OSUtils�c�@�tjj|�Sr)�os�path�getsize�ra�filenames  r�
get_file_sizezOSUtils.get_file_size�s���w�w���x�(�(rc�6�tj||||d��S)NF)�enable_callbacks)�
ReadFileChunk�
from_filename)rar��
start_byter2rKs     r�open_file_chunk_readerzOSUtils.open_file_chunk_readers%���*�*��j�$�	�E�+�
�	
rNc�$�t||||d|��S)NF)rKr��close_callbacks)r�)ra�fileobj�
chunk_size�full_file_sizerKr�s      r�#open_file_chunk_reader_from_fileobjz+OSUtils.open_file_chunk_reader_from_fileobjs#�������"�+�

�	
rc��t||�Sr)�open)rar��modes   rr�zOSUtils.opens���H�d�#�#rc�N�	tj|�y#t$rYywxYw)z+Remove a file, noop if file does not exist.N)r��remove�OSErrorr�s  r�remove_filezOSUtils.remove_files%��	��I�I�h����	��	�s��	$�$c��t||�yr)r)ra�current_filename�new_filenames   rrzOSUtils.rename_file$s
���$�l�3rc�2�tjj|�sytj|�j}tj
|�rytj|�rytj|�rytj|�ryy)aChecks to see if a file is a special UNIX file.

        It checks if the file is a character special device, block special
        device, FIFO, or socket.

        :param filename: Name of the file

        :returns: True if the file is a special file. False, if is not.
        FT)	r�r��exists�stat�st_mode�S_ISCHR�S_ISBLK�S_ISFIFO�S_ISSOCK)�clsr�r�s   r�is_special_filezOSUtils.is_special_file'sj���w�w�~�~�h�'���w�w�x� �(�(���<�<�����<�<�����=�=�����=�=����rc�0�tjt�z}tjj	|�}tjj|�}|d|jt|�z
|z}tjj||�Sr)	r��extseprr��dirname�basename�_MAX_FILENAME_LEN�lenr)rar��suffixr��name�
temp_filenames      r�get_temp_filenamezOSUtils.get_temp_filenameDsp�����2�4�4���w�w���x�(���w�w����)���C�t�5�5��F��C�D�v�M�
��w�w�|�|�D�-�0�0rc��	|j|d�5}t||�ddd�y#1swYyxYw#t$r|j|��wxYw)N�wb)r�rr�r�)rar�r2�fs    r�allocatezOSUtils.allocateKsU��	����8�T�*�
#�a��!�T�"�
#�
#�
#���	����X�&��	�s�6�
*�6�3�6�6�Ar)
rdrerfr�r�r�r�r�r�rr�r�r�rRrrr�r��s:����)�
��

�"$��4��:1�rr�c�^�eZdZddefd�Zd�Zed��Zdd�Zd�Z	dd	�Z
d
�Zd�Zd�Z
d
�Zy)�DeferredOpenFiler�rbc�J�||_d|_||_||_||_y)a�A class that defers the opening of a file till needed

        This is useful for deferring opening of a file till it is needed
        in a separate thread, as there is a limit of how many open files
        there can be in a single thread for most operating systems. The
        file gets opened in the following methods: ``read()``, ``seek()``,
        and ``__enter__()``

        :type filename: str
        :param filename: The name of the file to open

        :type start_byte: int
        :param start_byte: The byte to seek to when the file is opened.

        :type mode: str
        :param mode: The mode to use to open the file

        :type open_function: function
        :param open_function: The function to use to open the file
        N)�	_filename�_fileobj�_start_byte�_mode�_open_function)rar�r�r��
open_functions     rrczDeferredOpenFile.__init__Us)��*"�����
�%�����
�+��rc���|j�a|j|j|j�|_|jdk7r&|jj|j�yyy�Nr)r�r�r�r�r��seekrrs r�_open_if_neededz DeferredOpenFile._open_if_neededpsX���=�=� � �/�/�����
�
�K�D�M����1�$��
�
�"�"�4�#3�#3�4�%�!rc��|jSr)r�rrs rr�zDeferredOpenFile.namevs���~�~�rNc�X�|j�|jj|�Sr)r�r��read)ra�amounts  rr�zDeferredOpenFile.readzs#�������}�}�!�!�&�)�)rc�Z�|j�|jj|�yr)r�r��write)ra�datas  rr�zDeferredOpenFile.write~s �������
�
���D�!rc�\�|j�|jj||�yr)r�r�r�)ra�where�whences   rr�zDeferredOpenFile.seek�s"�������
�
���5�&�)rc�f�|j�|jS|jj�Sr)r�r��tellrrs rr�zDeferredOpenFile.tell�s+���=�=� ��#�#�#��}�}�!�!�#�#rc�R�|jr|jj�yyr)r��closerrs rr�zDeferredOpenFile.close�s���=�=��M�M���!�rc�&�|j�|Sr)r�rrs r�	__enter__zDeferredOpenFile.__enter__�s�������rc�$�|j�yr�r��raror's   r�__exit__zDeferredOpenFile.__exit__�����
�
�rr�r)rdrerfr�rcr�r�r�r�r�r�r�r�r�r�rRrrr�r�TsJ��,-�D��,�65�����*�"�*�$�
"��rr�c��eZdZ			dd�Ze		dd��Zd�Zdd�Zd�Zd�Z	d�Z
d	�Zdd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zy)r�Nc�
�||_|jj�|_|j|j||j|��|_d|_||_|�g|_||_||_|�||_yy)a�

        Given a file object shown below::

            |___________________________________________________|
            0          |                 |                 full_file_size
                       |----chunk_size---|
                    f.tell()

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

        :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 callbacks: A list of function(amount_read)
        :param callbacks: Called whenever data is read from this object in the
            order provided.

        :type enable_callbacks: boolean
        :param enable_callbacks: True if to run callbacks. Otherwise, do not
            run callbacks

        :type close_callbacks: A list of function()
        :param close_callbacks: Called when close is called. The function
            should take no arguments.
        )�requested_sizer��actual_file_sizerN)	r�r�r��_calculate_file_size�_size�_amount_read�
_callbacks�_callbacks_enabled�_close_callbacks)rar�r�r�rKr�r�s       rrczReadFileChunk.__init__�s���T ��
��=�=�-�-�/����.�.��M�M�%��'�'�+�	/�
��
����#����� �D�O�"2��� /����"�$3�D�!�#rc��t|d�}|j|�tj|j	��j
}||||||�S)a[Convenience 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 callbacks: function(amount_read)
        :param callbacks: Called whenever data is read from this object.

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

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

        r�)r�r�r��fstat�fileno�st_size)r�r�r�r�rKr�r��	file_sizes        rr�zReadFileChunk.from_filename�sK��D
��4� ��	���z���H�H�Q�X�X�Z�(�0�0�	��1�j�)�Y�8H�I�Irc�$�||z
}t||�Sr)�min)rar�r�r�r��max_chunk_sizes      rr�z"ReadFileChunk._calculate_file_size�s��*�J�6���>�>�2�2rc�N�t|j|jz
d�}|�|}nt||�}|jj|�}|xjt
|�z
c_|j�+|jrt|jt
|��|Sr�)
�maxr�r�r�r�r�r�r�r�rT)rar��amount_left�amount_to_readr�s     rr�zReadFileChunk.reads����$�*�*�t�'8�'8�8�!�<���>�(�N� ��f�5�N��}�}�!�!�.�1�����S��Y�&���?�?�&�4�+B�+B�%�d�o�o�s�4�y�A��rc��|j�t|jd�r|jj�yy)Nr*)�enable_callbackr#r�r*rrs rr*z!ReadFileChunk.signal_transferrings2�������4�=�=�"7�8��M�M�-�-�/�9rc��|j�t|jd�r|jj�yy)Nr")�disable_callbackr#r�r"rrs rr"z%ReadFileChunk.signal_not_transferrings2�������4�=�=�";�<��M�M�1�1�3�=rc��d|_y�NT�r�rrs rrzReadFileChunk.enable_callbacks
��"&��rc��d|_y)NFrrrs rrzReadFileChunk.disable_callbacks
��"'��rc�6�|dvrtd|�d���||jz
}|dk(r||jz
}n|dk(r||jz
}|jjt
||j��|j�u|jrit
t||jz
|j�d�}t|j|j�}||z
}t|j|��t
||jz
d�|_y)N)rr6�zinvalid whence (z, should be 0, 1 or 2)r6rrrP)�
ValueErrorr�r�r�r�r�r�r�r�r�rT)rar�r��
bounded_where�bounded_amount_readr�s      rr�zReadFileChunk.seeks����"��/��x�7M�N�O�O�	��!�!�!���Q�;��T�&�&�&�E�
�q�[��T�Z�Z��E��
�
���3�u�d�&6�&6�7�8��?�?�&�4�+B�+B���E�D�,<�,<�$<�d�j�j� I�1�M�M�"%�d�&7�&7����"D��"�%8�8�F�%����6�
� ���(8�(8� 8�!�<��rc��|j�$|jr|jD]	}|��|jj�yr)r�r�r�r�r�s  rr�zReadFileChunk.close6s@��� � �,��1H�1H� �1�1�
���
�
��
�
���rc��|jSr)r�rrs rr�zReadFileChunk.tell<s��� � � rc��|jSr)r�rrs r�__len__zReadFileChunk.__len__?s���z�z�rc��|SrrRrrs rr�zReadFileChunk.__enter__Gs���rc�$�|j�yrr�r�s   rr�zReadFileChunk.__exit__Jr�rc��tg�Sr)�iterrrs r�__iter__zReadFileChunk.__iter__Ms
���B�x�r)NTNrrr�)rdrerfrc�classmethodr�r�r�r*r"rrr�r�r�rr�r�rrRrrr�r��ss�����;4�z���
$J��$J�L3�
�0�
4�
'�(�=�0�!����rr�c��eZdZdZdd�Zd�Zy)�StreamReaderProgressz<Wrapper for a read only stream that adds progress callbacks.Nc�4�||_||_|�g|_yyr)�_streamr�)ra�streamrKs   rrczStreamReaderProgress.__init__Ys"�����#����� �D�O�rc�|�|jj|i|��}t|jt	|��|Sr)rr�rTr�r�)raror'r[s    rr�zStreamReaderProgress.read_s4��!����!�!�4�2�6�2��!�$�/�/�3�u�:�>��rr)rdrerfrvrcr�rRrrrrVs��F�!�rrc��eZdZy)�NoResourcesAvailableN)rdrerfrRrrrres��rrc� �eZdZd�Zdd�Zd�Zy)�
TaskSemaphorec�8�tj|�|_y)zqA semaphore for the purpose of limiting the number of tasks

        :param count: The size of semaphore
        N)rz�	Semaphore�
_semaphore�ra�counts  rrczTaskSemaphore.__init__js��
$�-�-�e�4��rc��tjd|�|jj|�st	d|z��y)a�Acquire the semaphore

        :param tag: A tag identifying what is acquiring the semaphore. Note
            that this is not really needed to directly use this class but is
            needed for API compatibility with the SlidingWindowSemaphore
            implementation.
        :param block: If True, block until it can be acquired. If False,
            do not block and raise an exception if cannot be acquired.

        :returns: A token (can be None) to use when releasing the semaphore
        �Acquiring %s�Cannot acquire tag '%s'N)�logger�debugr"�acquirer)ra�tag�blockings   rr*zTaskSemaphore.acquireqs:��	���^�S�)����&�&�x�0�&�'@�3�'F�G�G�1rc�n�tjd|�d|���|jj�y)atRelease the semaphore

        :param tag: A tag identifying what is releasing the semaphore
        :param acquire_token:  The token returned from when the semaphore was
            acquired. Note that this is not really needed to directly use this
            class but is needed for API compatibility with the
            SlidingWindowSemaphore implementation.
        zReleasing acquire �/N)r(r)r"�release)rar+�
acquire_tokens   rr/zTaskSemaphore.release�s.��	���)�#��a�
��?�@������!rN�T)rdrerfrcr*r/rRrrrris��5�H� 
"rrc�*�eZdZdZd�Zd�Zdd�Zd�Zy)�SlidingWindowSemaphorea�A semaphore used to coordinate sequential resource access.

    This class is similar to the stdlib BoundedSemaphore:

    * It's initialized with a count.
    * Each call to ``acquire()`` decrements the counter.
    * If the count is at zero, then ``acquire()`` will either block until the
      count increases, or if ``blocking=False``, then it will raise
      a NoResourcesAvailable exception indicating that it failed to acquire the
      semaphore.

    The main difference is that this semaphore is used to limit
    access to a resource that requires sequential access.  For example,
    if I want to access resource R that has 20 subresources R_0 - R_19,
    this semaphore can also enforce that you only have a max range of
    10 at any given point in time.  You must also specify a tag name
    when you acquire the semaphore.  The sliding window semantics apply
    on a per tag basis.  The internal count will only be incremented
    when the minimum sequence number for a tag is released.

    c���||_tt�|_i|_tj�|_tj|j�|_	i|_
yr)r~rr.�_tag_sequences�_lowest_sequencerzr{r|�	Condition�
_condition�_pending_releaser#s  rrczSlidingWindowSemaphore.__init__�sJ�����)�#�.��� "����^�^�%��
�#�-�-�d�j�j�9��� "��rc�^�|j5|jcddd�S#1swYyxYwrr�rrs rr�z$SlidingWindowSemaphore.current_count�s%��
�Z�Z�	��;�;�	�	�	�r�c�(�tjd|�|jj�	|jdk(rI|std|z��|jdk(r*|jj
�|jdk(r�*|j|}|dk(r||j|<|j|xxdz
cc<|xjdzc_||jj�S#|jj�wxYw)Nr&rr'r6)
r(r)r8r*r~r�waitr5r6r/)rar+r,�sequence_numbers    rr*zSlidingWindowSemaphore.acquire�s������^�S�)������!�	&��{�{�a���.�/H�3�/N�O�O��+�+��*����,�,�.��+�+��*�#�1�1�#�6�O��!�#�-<��%�%�c�*�����$��)�$��K�K�1��K�"��O�O�#�#�%��D�O�O�#�#�%�s�AC5�
AC5�5Dc��|}tjd||�|jj�	||jvrtd|z��|j|}|j||k(r�|j|xxdz
cc<|xjdz
c_|jj�|jj|g�}|r�|j||dk(r=|j�|j|xxdz
cc<|xjdz
c_nn{|r�Vnw|j||cxkr|krNnnK|jj|g�j|�|j|jd��ntd|�d|����|jj�y#|jj�wxYw)	NzReleasing acquire %s/%sz$Attempted to release unknown tag: %sr6���T)�reversez-Attempted to release unknown sequence number z
 for tag: )r(r)r8r*r5r	r6r~�notifyr9�get�pop�
setdefaultrF�sortr/)rar+r0r=�max_sequence�queueds      rr/zSlidingWindowSemaphore.release�s���'�����.��_�E������!� 	&��$�-�-�-� �!G�#�!M�N�N��.�.�s�3�L��$�$�S�)�_�<��%�%�c�*�a�/�*����q� �����&�&�(��.�.�2�2�3��;����,�,�S�1�V�B�Z�?��
�
���-�-�c�2�a�7�2����q�(���
��&�&�s�+�o�L��L��%�%�0�0��b�9�@�@�#���%�%�c�*�/�/��/�=� �(7��>���

�O�O�#�#�%��D�O�O�#�#�%�s�C6F?�,A8F?�?GNr1)rdrerfrvrcr�r*r/rRrrr3r3�s���,#��&�,$&rr3c�.�eZdZeeefd�Zdd�Zd�Zd�Z	y)�ChunksizeAdjusterc�.�||_||_||_yr)�max_size�min_size�	max_parts)rarKrLrMs    rrczChunksizeAdjuster.__init__�s��!��
� ��
�"��rNc�P�|}|�|j||�}|j|�S)a�Get a chunksize close to current that fits within all S3 limits.

        :type current_chunksize: int
        :param current_chunksize: The currently configured chunksize.

        :type file_size: int or None
        :param file_size: The size of the file to upload. This might be None
            if the object being transferred has an unknown size.

        :returns: A valid chunksize that fits within configured limits.
        )�_adjust_for_max_parts�_adjust_for_chunksize_limits)ra�current_chunksizer��	chunksizes    r�adjust_chunksizez"ChunksizeAdjuster.adjust_chunksize�s2��&�	�� ��2�2�9�i�H�I��0�0��;�;rc�
�||jkDr2tjd|j�d|�d��|jS||jkr2tjd|j�d|�d��|jS|S)Nz5Chunksize greater than maximum chunksize. Setting to � from �.z2Chunksize less than minimum chunksize. Setting to )rKr(r)rL)rarQs  rrPz.ChunksizeAdjuster._adjust_for_chunksize_limitssp���t�}�}�,��L�L�,0�M�M�;L�N�
��=�=� �
����
.��L�L�,0�M�M�;L�N�
��=�=� �$�$rc�<�|}ttj|t|�z��}||jkDr?|dz}ttj|t|�z��}||jkDr�?||k7rt
j
d|�d|�d��|S)NrzPChunksize would result in the number of parts exceeding the maximum. Setting to rUrV)r.r/r0r1rMr(r))rarQr�rRr:s     rrOz'ChunksizeAdjuster._adjust_for_max_partss���%�	���	�	�)�e�I�.>�">�?�@�	��$�.�.�(���N�I��D�I�I�i�%�	�2B�&B�C�D�I��$�.�.�(��)�)��L�L��/�1�
��rr)
rdrerf�MAX_SINGLE_UPLOAD_SIZE�MIN_UPLOAD_CHUNKSIZE�	MAX_PARTSrcrSrPrOrRrrrIrI�s!��(�%��	#�<�"%� rrIc�0�t|�rd|vrd|d<yyy)N�ChecksumAlgorithm�crc32r)�bucket�
extra_argss  r�add_s3express_defaultsr`.s&���6�"�':�*�'L�*1�
�&�'�(M�"r)�r)4rG�loggingr/r�r�socketr�rrz�collectionsr�botocore.exceptionsrrr�botocore.httpchecksumr�botocore.utilsr	�s3transfer.compatr
rrrZrXrY�	getLoggerrdr(�timeout�S3_RETRYABLE_DOWNLOAD_ERRORSrr"r*r4r?rNrTr\r^rhrxr�r�r�r�	Exceptionrrr3rIr`rRrr�<module>rms3�����	�
�
��
��#���
4�.�B�B��	�'��$��	��	�	�8�	$���N�N����� ��O�/�'�3�
26��<�:
:� �$	&�	&�7�7�*/!�/!�dU�U�p@�@�F|�|�~��	�9�	�""�""�J_&�]�_&�D;�;�|2r
¿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!