Current File : //proc/self/root/usr/lib/python3/dist-packages/ptyprocess/__pycache__/ptyprocess.cpython-312.pyc
�

�.�c�{����ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZ	ddlZddlmZmZddlmZmZe	j(j+�Zej/d�xsej/d�Zer	dZddlmZnd	Ze	j8dd
k\Zerd�Znd�ZGd
�de�Z Gd�de�Z!d\a"a#d�Z$d�Z%d�Z&Gd�de'�Z(Gd�de(�Z)y#e
$rddlZY��wxYw)�N)�STDIN_FILENO�CHILD�)�which�PtyProcessError�solaris�sunosF)�	_fork_ptyT�c��t|g�S�N)�bytes��is �7/usr/lib/python3/dist-packages/ptyprocess/ptyprocess.py�_byter(s���a�S�z��c��t|�Sr
)�chrrs rrr+s���1�v�
rc��eZdZy)�FileNotFoundErrorN��__name__�
__module__�__qualname__�rrrr.��rrc��eZdZy)�TimeoutErrorNrrrrrr/rrr)NNc�>�t�t�y	ddlm}m}d}dD]6}ttd|zd�}|�t|d�s�&	|j�}�8|�td��ttj|�d|�}ttj|�d|�}t%|�at%|�ay#t$rY��wxYw#tttttjf$r%	dd	lm}m}||}}n#t$rd
\}}YnwxYwY�rwxYw)zkSet constants _EOF and _INTR.
    
    This avoids doing potentially costly operations on module load.
    Nr)�VEOF�VINTR)�stdin�stdoutz__%s__�filenozNo stream has a fileno�)�CEOF�CINTR)r�)�_EOF�_INTR�termiosr!r"�getattr�sys�hasattrr%�
ValueError�ord�	tcgetattr�ImportError�OSError�IOError�errorr'r(r)	r!r"�fd�name�stream�intr�eofr'r(s	         r�_make_eof_intrr<3s"��	
��u�0��!�'�
��%�	�D��S�(�T�/�4�8�F��~�W�V�X�%>��
��]�]�_��	��:��5�6�6��7�$�$�R�(��+�E�2�3���'�#�#�B�'��*�4�0�1��
�$�K�E���:�D��'�
��
��
��'�:�w�}�}�E�	!�	!�+� �$�3�T���	!� �K�T�3�	!��	!�sZ�2C�C�AC�	C�	C�C�C�(D�8D�D�D�D�D�D�Dc�x�d}	tj|�}|r|dtjz|d<n|dtjz|d<	tj|tj|�y#tj$rR}|jdtj
k(r,t
|jd|jd�d|�d����d}~wwxYw#t$rR}|jdtj
k(r,t
|jd|jd�d|�d����d}~wwxYw)Nz~setecho() may not be called on this platform (it may still be possible to enable/disable echo when spawning the child process)rr�: �.r)
r,r2r6�args�errno�EINVALr5�ECHO�	tcsetattr�TCSANOW)r7�state�errmsg�attr�errs     r�_setechorJ^s��N�F��� � ��$��
��q�'�G�L�L�(��Q���q�'�W�\�\�M�)��Q���	���"�g�o�o�t�4���=�=���8�8�A�;�%�,�,�&��#�(�(�1�+�C�H�H�Q�K��'H�I�I�
�������8�8�A�;�%�,�,�&��#�(�(�1�+�C�H�H�Q�K��'H�I�I�
���s1�A6�%C�6C�	A
C�C�	D9�'A
D4�4D9c��ttdd�}tjd||dd�}t	j
|||�y)N�
TIOCSWINSZigt��HHHHr)r-r,�struct�pack�fcntl�ioctl)r7�rows�colsrL�ss     r�_setwinsizerUvs8��
��,��<�J����F�D�$��1�-�A�	�K�K��J��"rc��eZdZdZeZer5ejjd�Zdjd�Z
ed��Zn$ejZdZ
e
jjZdZdZdZdZd�Ze		d!d��Zd�Zed	��Zed
��Zd�Zd�Zd"d
�Zd�Zd�Zd#d�Zd�Z d�Z!d$d�Z"d�Z#d"d�Z$d"d�Zd�Z%d�Z&d�Z'd�Z(d%d�Z)d�Z*d�Z+d�Z,d�Z-d �Z.y)&�
PtyProcessz�This class represents a process running in a pseudoterminal.
    
    The main constructor is the :meth:`spawn` classmethod.
    �asciiz
c���	tjjj|�S#t$r2tjj|jdd��cYSwxYw)NrX�replace)r.r$�buffer�write�AttributeError�decode)�bs r�write_to_stdoutzPtyProcess.write_to_stdout�sT��
F��z�z�(�(�.�.�q�1�1��!�
F��z�z�'�'�����)�(D�E�E�
F�s�(+�8A&�%A&Nc�<�t�||_||_tj|dd��}tj|ddd��}tj
||�|_d|_d|_d|_	d|_
d|_d|_d|_
d|_y)N�rbr)�	buffering�wbF)rc�closefd皙�����?)r<�pidr7�io�open�BufferedRWPair�fileobj�
terminated�closed�
exitstatus�signalstatus�status�flag_eof�delayafterclose�delayafterterminate)�selfrgr7�readf�writefs     r�__init__zPtyProcess.__init__�s���������������D�A�.������T�Q��>���(�(���7������������ ��������
� #���$'�� rc�:
�t|ttf�std|z��|dd}|d}t	|�}	|	�tdd|zz��|	}||d<t
j�\}
}trtj�\}}
ntj�\}}
|tk(�r>	ttg|���|s	t+td�t
j0|
�t3j2|t2j4t2j6�t9dt;j<t:j>�d�}tAtC|�|hz�}tEdg|z||gz�D]!}t
jF|dd	z|d	��#|�t
jH|�|�	|�	|�t
j\||�nt
j^|||�|||
�}||_2|�||_3|�||_4t
j0|�t
jj|
d
�}t
j0|
�tm|�dk7rm	|jodd�\}}}tqtr|jud�tJ�}||judd��}|t`urtw|�|_|�	|jx|�|S#t $r;}|j"dt$j&t$j(fvr�Yd}~��[d}~wwxYw#t t,j.f$r;}|j"dt$j&t$j(fvr�Yd}~���d}~wwxYw#tJ$r�}tM|�jN}d
jQ|tS|��}tTr|jWd�}t
jX||�t
j0|�t
jZd	�Yd}~��Td}~wwxYw#t`$r�}djQ|j$tS|��}tTr|jWd�}t
jX||�t
j0|�t
jZtjb�Yd}~���d}~wwxYw#tKd|z��xYw#t $rJ}|j"dt$j&t$j(t$jzfvr�Yd}~|Sd}~wwxYw)a�Start the given command in a child process in a pseudo terminal.

        This does all the fork/exec type of stuff for a pty, and returns an
        instance of PtyProcess.

        If preexec_fn is supplied, it will be called with no arguments in the
        child process before exec-ing the specified command.
        It may, for instance, set signal handlers to SIG_DFL or SIG_IGN.

        Dimensions of the psuedoterminal used for the subprocess can be
        specified as a tuple (rows, cols), or the default (24, 80) will be used.

        By default, all file descriptors except 0, 1 and 2 are closed. This
        behavior can be overridden with pass_fds, a list of file descriptors to
        keep open between the parent and the child.
        z)Expected a list or tuple for argv, got %rNrz%The command was not found or was not zexecutable: %s.Fi�rz{}:0:{}�utf-8z
OSError:{}:{}i�:rXrZz)Subprocess failed, got bad error data: %r)>�
isinstance�list�tuple�	TypeErrorrr�os�pipe�use_native_pty_fork�pty�forkr
�fork_ptyrrUrr5r@rArB�ENOTTYrJr,r6�closerP�F_SETFD�
FD_CLOEXEC�min�resource�	getrlimit�
RLIMIT_NOFILE�sorted�set�zip�
closerange�chdir�	Exception�typer�format�str�PY3�encoder\�_exit�execv�execvper4�EX_OSERR�argv�env�
launch_dir�read�len�splitr-�builtinsr^�int�
setwinsize�ENXIO)�clsr��cwdr��echo�
preexec_fn�
dimensions�pass_fds�command�command_with_path�exec_err_pipe_read�exec_err_pipe_writergr7rI�max_fd�	spass_fds�pair�e�ename�tosend�inst�
exec_err_data�errclass�errno_srG�exctype�	exceptions                            r�spawnzPtyProcess.spawn�sk��8�$��u�
�.��G�$�N�O�O��A�w���q�'��!�'�N���$�#�$K�$5��$?�%@�A�
A�#����Q��35�'�'�)�/��/���h�h�j�G�C�� �(�(�*�G�C���%�<�
��L�6�:�6����\�5�1�
�H�H�'�(��K�K�+�U�]�]�E�<L�<L�M���(�"4�"4�X�5K�5K�"L�Q�"O�P�F��s�8�}�0C�/D�D�E�I��Q�C�)�O�Y�&��-A�B�
2���
�
�d�1�g�a�i��a��1�
2�������
��%�
 ��L�

&��;��H�H�W�d�+��J�J�w��c�2��3��|����	��?��D�H��?�!�D�O�	���$�%���� 2�D�9�
�
���#�$��}���"�
 �,9�,?�,?��a�,H�)��'�6�!�(�H�O�O�G�,D�i�P��#�F�M�M�'�9�$E�F�	��g�%�&)�'�l�I�O�
 ��	��D�O�O�Z�(�
���K�
��8�8�A�;�u�|�|�U�\�\�&B�B��C��
�� ����/���x�x��{�5�<�<����*F�F��G����4!� � ��G�,�,�E�&�-�-�e�S��V�<�F��!'���w�!7���H�H�0�&�9��H�H�0�1��H�H�Q�K�K�� ���
&�)�/�/��	�	�3�s�8�D���#�]�]�7�3�F����,�f�5����,�-�������%�%��
&��P
5�� K�&3�!4�5�5���	��x�x��{�5�<�<����u�{�{�"K�K��L����		�s��+K�>L�0M5�80P�A*R4�S�	L� 0L�L�M2�70M-�-M2�5	P�>BP�P�	R1�B
R,�,R1�4S�	T�?T�Tc��t|�j}|j��t|j�g}|j�|jd|jz�|j�|jd|jz�dj|dj|��Sdj||j|j�S)Nzenv=%rzcwd=%rz{}.spawn({})z, z{}(pid={}, fd={}))r�rr��reprr��appendr�r��joinrgr7)rt�clsnamer@s   r�__repr__zPtyProcess.__repr__Zs����t�*�%�%���9�9� �����O�$�D��x�x�#����H�t�x�x�/�0����*����H�t���6�7�!�(�(��$�)�)�D�/�B�B�'�-�-�g�t�x�x����I�Irc�H�t|t�s|jd�S|S)Nrz)r|rr��rTs r�_coerce_send_stringzPtyProcess._coerce_send_stringhs ���!�U�#��8�8�G�$�$��rc��|Sr
rr�s r�_coerce_read_stringzPtyProcess._coerce_read_stringns���rc�N�|js	|j�yy#YyxYw)aLThis makes sure that no system resources are left open. Python only
        garbage collects Python objects. OS file descriptors are not Python
        objects, so they must be handled explicitly. If the child file
        descriptor was opened outside of this class (passed to the constructor)
        then this does not close it. N)rmr��rts r�__del__zPtyProcess.__del__rs(���{�{�
��
�
����
��s� �$c��|jS)zCThis returns the file descriptor of the pty for the child.
        )r7r�s rr%zPtyProcess.fileno�s
���w�w�rc�$�|js�|j�|jj�t	j
|j�|j�r|j|�std��d|_
d|_yy)a?This closes the connection with the child application. Note that
        calling close() more than once is valid. This emulates standard Python
        behavior with files. Set force to True if you want to make sure that
        the child is terminated (SIGKILL is sent if the child ignores SIGHUP
        and SIGINT). zCould not terminate the child.���TN)rm�flushrkr��time�sleeprr�isalive�	terminaterr7�rt�forces  rr�zPtyProcess.close�sj���{�{��J�J�L��L�L��� ��J�J�t�+�+�,��|�|�~��~�~�e�,�)�*J�K�K��D�G��D�K�rc��y)zWThis does nothing. It is here to support the interface for a
        File-like object. Nrr�s rr�zPtyProcess.flush�s��	
rc�@�tj|j�S)a^This returns True if the file descriptor is open and connected to a
        tty(-like) device, else False.

        On SVR4-style platforms implementing streams, such as SunOS and HP-UX,
        the child pty may not appear as a terminal device.  This means
        methods such as setecho(), setwinsize(), getwinsize() may raise an
        IOError. )r��isattyr7r�s rr�zPtyProcess.isatty�s���y�y����!�!rc���|�tj�|z}	|j�sy|dkr|�y|�tj�z
}tjd��H)a�This waits until the terminal ECHO flag is set False. This returns
        True if the echo mode is off. This returns False if the ECHO flag was
        not set False before the timeout. This can be used to detect when the
        child is waiting for a password. Usually a child application will turn
        off echo mode when it is waiting for the user to enter a password. For
        example, instead of expecting the "password:" prompt you can wait for
        the child to set ECHO off::

            p = pexpect.spawn('ssh user@example.com')
            p.waitnoecho()
            p.sendline(mypassword)

        If timeout==None then this method to block until ECHO flag is False.
        TrFrf)r��getechor�)rt�timeout�end_times   r�
waitnoechozPtyProcess.waitnoecho�s^�� ���y�y�{�W�,�H���<�<�>����{�w�2���"�"�T�Y�Y�[�0���J�J�s�O�rc�v�	tj|j�}t|dtjz�|_
|jS#tj$rT}d}|jdt
jk(r,t|jd|jd�d|�d����d}~wwxYw)aThis returns the terminal echo mode. This returns True if echo is
        on or False if echo is off. Child applications that are expecting you
        to enter a password often set ECHO False. See waitnoecho().

        Not supported on platforms where ``isatty()`` returns False.  z,getecho() may not be called on this platformrrr>r?Nr)r,r2r7r6r@rArBr5�boolrCr�)rtrHrIrGs    rr�zPtyProcess.getecho�s���	��$�$�T�W�W�-�D���a��7�<�<�/�0��	��y�y����}�}�	�C�F��x�x��{�e�l�l�*��c�h�h�q�k������V�+L�M�M���		�s�A�B8�$AB3�3B8c�>�t|j|�||_y)aZThis sets the terminal echo mode on or off. Note that anything the
        child sent before the echo will be lost, so you should be sure that
        your input buffer is empty before you call setecho(). For example, the
        following will work as expected::

            p = pexpect.spawn('cat') # Echo is on by default.
            p.sendline('1234') # We expect see this twice from the child...
            p.expect(['1234']) # ... once from the tty echo...
            p.expect(['1234']) # ... and again from cat itself.
            p.setecho(False) # Turn off tty echo
            p.sendline('abcd') # We will set this only once (echoed by cat).
            p.sendline('wxyz') # We will set this only once (echoed by cat)
            p.expect(['abcd'])
            p.expect(['wxyz'])

        The following WILL NOT WORK because the lines sent before the setecho
        will be lost::

            p = pexpect.spawn('cat')
            p.sendline('1234')
            p.setecho(False) # Turn off tty echo
            p.sendline('abcd') # We will set this only once (echoed by cat).
            p.sendline('wxyz') # We will set this only once (echoed by cat)
            p.expect(['1234'])
            p.expect(['1234'])
            p.expect(['abcd'])
            p.expect(['wxyz'])


        Not supported on platforms where ``isatty()`` returns False.
        N)rJr7r�)rtrFs  r�setechozPtyProcess.setecho�s��@	����%� ���	rc��	|jj|�}|dk(rd|_td��|S#ttf$r8}|jdt
jk(rd|_td���d}~wwxYw)aRead and return at most ``size`` bytes from the pty.

        Can block if there is nothing to read. Raises :exc:`EOFError` if the
        terminal was closed.
        
        Unlike Pexpect's ``read_nonblocking`` method, this doesn't try to deal
        with the vagaries of EOF on platforms that do strange things, like IRIX
        or older Solaris systems. It handles the errno=EIO pattern used on
        Linux, and the empty-string return used on BSD platforms and (seemingly)
        on recent Solaris.
        rT�,End Of File (EOF). Exception style platform.Nr�/End Of File (EOF). Empty string style platform.)	rk�read1r4r5r@rA�EIOrq�EOFError)rt�sizerTrIs    rr�zPtyProcess.read�s}��	����"�"�4�(�A�
��8� �D�M��L�M�M������!�	��x�x��{�e�i�i�'� $��
��M�N�N���	�s�6�A=�3A8�8A=c��	|jj�}|dk(rd|_td��|S#ttf$r8}|jdt
jk(rd|_td���d}~wwxYw)��Read one line from the pseudoterminal, and return it as unicode.

        Can block if there is nothing to read. Raises :exc:`EOFError` if the
        terminal was closed.
        rTr�Nrr�)	rk�readliner4r5r@rAr�rqr�)rtrTrIs   rr�zPtyProcess.readlines{��	����%�%�'�A�
��8� �D�M��L�M�M������!�	��x�x��{�e�i�i�'� $��
��M�N�N���	�s�5�A<�3A7�7A<c�t�|jj|�}|r|jj�|Sr
)rkr\r�)rtr_r��ns    r�_writebzPtyProcess._writeb-s.���L�L���q�!����L�L��� ��rc�(�|j||��S)zaWrite bytes to the pseudoterminal.
        
        Returns the number of bytes written.
        )r�)r�)rtrTr�s   rr\zPtyProcess.write3s��
�|�|�A�U�|�+�+rc
��|j�}t|�}d|cxkrdkr2nn/|td�z
dz}t|�}|j|�|fSddddddddd	d	d
dd�}||vry
t||�}|j|�|fS)aHelper method that wraps send() with mnemonic access for sending control
        character to the child (such as Ctrl-C or Ctrl-D).  For example, to send
        Ctrl-G (ASCII 7, bell, '')::

            child.sendcontrol('g')

        See also, sendintr() and sendeof().
        �a�z�arr������)�@�`�[�{�\�|�]�}�^�~�_�?)rr)�lowerr1rr�)rt�charr��byte�ds     r�sendcontrolzPtyProcess.sendcontrol:s����z�z�|����I��
��>�c�>��C��H��q� �A���8�D��<�<��%�t�+�+��!��"��2��"��"���

���q�=���Q�t�W�~���|�|�D�!�4�'�'rc�8�|jt�tfS)a1This sends an EOF to the child. This sends a character which causes
        the pending parent output buffer to be sent to the waiting child
        program without waiting for end-of-line. If it is the first character
        of the line, the read() in the user program returns 0, which signifies
        end-of-file. This means to work as expected a sendeof() has to be
        called at the beginning of a line. This method does not send a newline.
        It is the responsibility of the caller to ensure the eof is sent at the
        beginning of a line. )r�r*r�s r�sendeofzPtyProcess.sendeofVs���|�|�D�!�4�'�'rc�8�|jt�tfS)znThis sends a SIGINT to the child. It does not require
        the SIGINT to be the first character on a line. )r�r+r�s r�sendintrzPtyProcess.sendintrbs���|�|�E�"�E�)�)rc��|jS)z@This returns True if the EOF exception was ever raised.
        )rqr�s rr;zPtyProcess.eofhs���}�}�rc�&�|j�sy	|jtj�t	j
|j�|j�sy|jtj�t	j
|j�|j�sy|jtj�t	j
|j�|j�sy|rP|jtj�t	j
|j�|j�syyy#t$r4t	j
|j�|j�sYyYywxYw)z�This forces a child process to terminate. It starts nicely with
        SIGHUP and SIGINT. If "force" is True then moves onto SIGKILL. This
        returns True if the child was terminated. This returns False if the
        child could not be terminated. TF)r��kill�signal�SIGHUPr�r�rs�SIGCONT�SIGINT�SIGKILLr4r�s  rr�zPtyProcess.terminatens���|�|�~��	��I�I�f�m�m�$��J�J�t�/�/�0��<�<�>���I�I�f�n�n�%��J�J�t�/�/�0��<�<�>���I�I�f�m�m�$��J�J�t�/�/�0��<�<�>����	�	�&�.�.�)��
�
�4�3�3�4��|�|�~�� ����		�

�J�J�t�/�/�0��<�<�>���		�s'�AE�"AE�1AE�AE�8F�Fc�N�|j�r$tj|jd�\}}n|jStj
|�|_tj|�r;||_tj
|�|_d|_d|_	|jStj|�r;||_d|_tj|�|_d|_	|jStj|�rtd��|jS)amThis waits until the child exits. This is a blocking call. This will
        not read any data from the child, so this will block forever if the
        child has unread output and has terminated. In other words, the child
        may have printed output then called exit(), but, the child is
        technically still alive until its output is read by the parent. rNTz�Called wait() on a stopped child process. This is not supported. Is some other process attempting job control with our child pid?)r�r��waitpidrgrn�WEXITSTATUS�	WIFEXITEDrprorl�WIFSIGNALED�WTERMSIG�
WIFSTOPPEDr)rtrgrps   r�waitzPtyProcess.wait�s����<�<�>��*�*�T�X�X�q�1�K�C���?�?�"��.�.��0���
�<�<��� �D�K� �n�n�V�4�D�O� $�D��"�D�O������^�^�F�
#� �D�K�"�D�O� "���F� 3�D��"�D�O������]�]�6�
"�!�#I�J�
J����rc�J�|jry|jrd}ntj}	tj|j
|�\}}|dk(r*	tj|j
|�\}}|dk(ry|dk(rytj|�r0||_tj|�|_
d|_d|_ytj|�r0||_d|_
tj |�|_d|_ytj"|�rtd��y#t$r.}|jtjk(rtd���d}~wwxYw#t$r.}|jtjk(rtd���d}~wwxYw)aZThis tests if the child process is running or not. This is
        non-blocking. If the child was terminated then this will read the
        exitstatus or signalstatus of the child. This returns True if the child
        process appears to be running or False if not. It can take literally
        SECONDS for Solaris to return the right status. Frz�isalive() encountered condition where "terminated" is 0, but there was no child process. Did someone else call waitpid() on our process?Nz�isalive() encountered condition that should never happen. There was no child process. Did someone else call waitpid() on our process?Tz�isalive() encountered condition where child process is stopped. This is not supported. Is some other process attempting job control with our child pid?)rlrqr��WNOHANGrrgr4rA�ECHILDrrrprrnrorrr)rt�waitpid_optionsrgrpr�s     rr�zPtyProcess.isalive�s����?�?���=�=�
 �O� �j�j�O�
	��*�*�T�X�X��?�K�C���!�8�
� �j�j����?�C���V� �a�x���!�8��
�<�<��� �D�K� �n�n�V�4�D�O� $�D��"�D�O���^�^�F�
#� �D�K�"�D�O� "���F� 3�D��"�D�O���]�]�6�
"�!�#6�7�
7���m�	��w�w�%�,�,�&�%�'*�+�+�
��	��$�
��7�7�e�l�l�*�)�+.�/�/�
��
�s/�#D1�#E+�1	E(�:)E#�#E(�+	F"�4)F�F"c�f�|j�r!tj|j|�yy)aSend the given signal to the child application.

        In keeping with UNIX tradition it has a misleading name. It does not
        necessarily kill the child unless you send the right signal. See the
        :mod:`signal` module for constants representing signal numbers.
        N)r�r�rrg)rt�sigs  rrzPtyProcess.kills$���<�<�>��G�G�D�H�H�c�"�rc���ttdd�}tjddddd�}t	j
|j||�}tjd|�ddS)zNReturn the window size of the pseudoterminal as a tuple (rows, cols).
        �
TIOCGWINSZiht@rMrry)r-r,rNrOrPrQr7�unpack)rtr&rT�xs    r�
getwinsizezPtyProcess.getwinsizesV���W�l�J�?�
��K�K���1�a��+���K�K�����Q�/���}�}�V�Q�'��!�,�,rc�0�t|j||�S)a@Set the terminal window size of the child tty.

        This will cause a SIGWINCH signal to be sent to the child. This does not
        change the physical window size. It changes the size reported to
        TTY-aware applications like vi or curses -- applications that respond to
        the SIGWINCH signal.
        )rUr7)rtrRrSs   rr�zPtyProcess.setwinsizes���4�7�7�D�$�/�/r)NNTN)��Pr)Tr
�i)F)/rrr�__doc__r�string_typer�r��linesepr��crlf�staticmethodr`r.r$r\�encodingr�r�r�rw�classmethodr�r�r�r�r�r%r�r�r�r�r�r�r�r�r�r
rrr;r�rr�rr)r�rrrrWrW�s<����K�
��*�*�#�#�G�,���}�}�W�%��	�	F�
�	F��*�*�����*�*�*�*���H��D�
�C��J�'�,�AE�*,�e��e�NJ�����
�����$�
�$
�	"��6�$"�H�6�*�,�(�8
(�*��&�P�:K�Z
#�-�0rrWc�R��eZdZdZereZneZd�fd�	Zd�fd�	Z	�fd�Z
�fd�Z�xZS)�PtyProcessUnicodez�Unicode wrapper around a process running in a pseudoterminal.

    This class exposes a similar interface to :class:`PtyProcess`, but its read
    methods return unicode, and its :meth:`write` accepts unicode.
    c���tt|�||�||_||_tj|�|��|_y)N)�errors)�superr6rwr3�codec_errors�codecs�getincrementaldecoder�decoder)rtrgr7r3r:�	__class__s     �rrwzPtyProcessUnicode.__init__*s=���
���/��R�8� ��
�(���=�v�3�3�H�=�\�R��rc�d��tt|�|�}|jj	|d��S)aRead at most ``size`` bytes from the pty, return them as unicode.

        Can block if there is nothing to read. Raises :exc:`EOFError` if the
        terminal was closed.

        The size argument still refers to bytes, not unicode code points.
        F��final)r9r6r�r=r^)rtr�r_r>s   �rr�zPtyProcessUnicode.read0s1���
�#�T�/��5���|�|�"�"�1�E�"�2�2rc�b��tt|��}|jj	|d��S)r�Fr@)r9r6r�r=r^)rtr_r>s  �rr�zPtyProcessUnicode.readline;s/���
�#�T�3�5���|�|�"�"�1�E�"�2�2rc�`��|j|j�}tt|�|�S)zlWrite the unicode string ``s`` to the pseudoterminal.

        Returns the number of bytes written.
        )r�r3r9r6r\)rtrTr_r>s   �rr\zPtyProcessUnicode.writeDs*���

�H�H�T�]�]�#���&��3�A�6�6r)rz�strictr-)
rrrr.r�r�r/�unicoderwr�r�r\�
__classcell__)r>s@rr6r6s1����
�����S�	3�3�7�7rr6)*r;rArPrhr�r�r�rrNr.r,r�r�r3�__builtin__rr�utilrr�platformr�	_platform�
startswith�_is_solarisr��r
�version_infor�rr4rrr*r+r<rJrU�objectrWr6rrr�<module>rPs��
���	�	�
��
�
�
���#��
&�(��L�L��� �	�����#�"�
����!��������	���q��Q������+�G�*�%�w�%����e�&�V�0#�\
0��\
0�~+7�
�+7��_�#�"�#�s�C'�'	C3�2C3
¿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!