Current File : //proc/self/root/lib/python3/dist-packages/twisted/web/__pycache__/resource.cpython-312.pyc
�

Ϫ�f&<���dZddlmZgd�ZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZdd	lmZdd
lmZddlmZddlmZmZdd
lmZGd�de	�Zd�Ze
e�Gd�d��Zd�ZGd�de�ZGd�de�ZGd�de�Z eZ!eZ"e Z#eedddd�de$d�eedddd�de$d �eedddd�d!e$d"�Gd#�d$e	�Z%e
e%�Gd%�d&ee���Z&y)'zp
Implementation of the lowest-level Resource class.

See L{twisted.web.pages} for some utility implementations.
�)�annotations)�	IResource�getChildForRequest�Resource�	ErrorPage�
NoResource�ForbiddenResource�EncodingResourceWrapperN)�Sequence)�	Attribute�	Interface�implementer)�Version)�nativeString)�proxyForInterface)�deprecatedModuleAttribute)�prefixedMethodNames)�	FORBIDDEN�	NOT_FOUND)�UnsupportedMethodc�4�eZdZdZed�Zd�Zdd�Zd�Zy)rz
    A web resource.
    z�
        Signal if this IResource implementor is a "leaf node" or not. If True,
        getChildWithDefault will not be called on this Resource.
        c��y)a
        Return a child with the given name for the given request.
        This is the external interface used by the Resource publishing
        machinery. If implementing IResource without subclassing
        Resource, it must be provided. However, if subclassing Resource,
        getChild overridden instead.

        @param name: A single path component from a requested URL.  For example,
            a request for I{http://example.com/foo/bar} will result in calls to
            this method with C{b"foo"} and C{b"bar"} as values for this
            argument.
        @type name: C{bytes}

        @param request: A representation of all of the information about the
            request that is being made for this child.
        @type request: L{twisted.web.server.Request}
        N�)�name�requests  �6/usr/lib/python3/dist-packages/twisted/web/resource.py�getChildWithDefaultzIResource.getChildWithDefault1���c��y)a0
        Put a child L{IResource} implementor at the given path.

        @param path: A single path component, to be interpreted relative to the
            path this resource is found at, at which to put the given child.
            For example, if resource A can be found at I{http://example.com/foo}
            then a call like C{A.putChild(b"bar", B)} will make resource B
            available at I{http://example.com/foo/bar}.

            The path component is I{not} URL-encoded -- pass C{b'foo bar'}
            rather than C{b'foo%20bar'}.
        Nr)�path�childs  r�putChildzIResource.putChildDrrc��y)ap
        Render a request. This is called on the leaf resource for a request.

        @return: Either C{server.NOT_DONE_YET} to indicate an asynchronous or a
            C{bytes} instance to write as the response to the request.  If
            C{NOT_DONE_YET} is returned, at some point later (for example, in a
            Deferred callback) call C{request.write(b"<html>")} to write data to
            the request, and C{request.finish()} to send the data to the
            browser.

        @raise twisted.web.error.UnsupportedMethod: If the HTTP verb
            requested is not supported by this resource.
        Nr�rs r�renderzIResource.renderRrrN)r!�bytesr"z'IResource'�return�None)	�__name__�
__module__�__qualname__�__doc__r�isLeafrr#r&rrrrr%s'����	��F��&�
rrc��|jrm|jsa|jjd�}|jj	|�|j||�}|jr
|js�a|S)zE
    Traverse resource tree to find who will handle the request.
    r)�postpathr.�pop�prepath�appendr)�resourcer�pathElements   rrrbse���
�
�8�?�?��&�&�*�*�1�-�������{�+��/�/��W�E���
�
�8�?�?��Orc��eZdZUdZeZded<dZd�ZdZ	d�Z
d�Zd	�Zd
�Z
d�Zdd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zy)ra
    Define a web-accessible resource.

    This serves two main purposes: one is to provide a standard representation
    for what HTTP specification calls an 'entity', and the other is to provide
    an abstract directory structure for URL retrieval.
    zSequence[bytes]�allowedMethodsNc��i|_y)z
        Initialize.
        N��children��selfs r�__init__zResource.__init__|s����
rrc�H�t|jj��S�N)�listr:�keysr;s r�listStaticNameszResource.listStaticNames�s���D�M�M�&�&�(�)�)rc�H�t|jj��Sr?)r@r:�itemsr;s r�listStaticEntitieszResource.listStaticEntities�s���D�M�M�'�'�)�*�*rc�V�t|j��|j�zSr?)r@rB�listDynamicNamesr;s r�	listNameszResource.listNames�s$���D�(�(�*�+�d�.C�.C�.E�E�Erc�V�t|j��|j�zSr?)r@rE�listDynamicEntitiesr;s r�listEntitieszResource.listEntities�s$���D�+�+�-�.��1I�1I�1K�K�Krc��gSr?rr;s rrGzResource.listDynamicNames�����	rc��gSr?r�r<rs  rrJzResource.listDynamicEntities�rMrc�8�|jj|�Sr?)r:�get�r<rs  r�getStaticEntityzResource.getStaticEntity�s���}�}� � ��&�&rc�D�||jvr|j||�Syr?�r:�getChild)r<rrs   r�getDynamicEntityzResource.getDynamicEntity�s"���t�}�}�$��=�=��w�/�/�rc��|j|=yr?r9rRs  r�	delEntityzResource.delEntity�s���M�M�$�rc�"�||j|<yr?r9)r<r�entitys   r�reallyPutEntityzResource.reallyPutEntity�s��$��
�
�d�rc��t�S)a<
        Retrieve a 'child' resource from me.

        Implement this to create dynamic resource generation -- resources which
        are always available may be registered with self.putChild().

        This will not be called if the class-level variable 'isLeaf' is set in
        your subclass; instead, the 'postpath' attribute of the request will be
        left as a list of the remaining path elements.

        For example, the URL /foo/bar/baz will normally be::

          | site.resource.getChild('foo').getChild('bar').getChild('baz').

        However, if the resource returned by 'bar' has isLeaf set to true, then
        the getChild call will never be made on it.

        Parameters and return value have the same meaning and requirements as
        those defined by L{IResource.getChildWithDefault}.
        )�_UnsafeNoResource�r<r!rs   rrVzResource.getChild�s
��*!�"�"rc�`�||jvr|j|S|j||�S)a�
        Retrieve a static or dynamically generated child resource from me.

        First checks if a resource was added manually by putChild, and then
        call getChild to check for dynamic resources. Only override if you want
        to affect behaviour of all child lookups, rather than just dynamic
        ones.

        This will check to see if I have a pre-registered child resource of the
        given name, and call getChild if I do not.

        @see: L{IResource.getChildWithDefault}
        rUr_s   rrzResource.getChildWithDefault�s0���4�=�=� ��=�=��&�&��}�}�T�7�+�+rc�P�tjdtd�t||�S)zz
        Deprecated in favor of L{getChildForRequest}.

        @see: L{twisted.web.resource.getChildForRequest}.
        z+Please use module level getChildForRequest.�)�warnings�warn�DeprecationWarningrrOs  rrzResource.getChildForRequest�s'��	�
�
�9�;M�q�	
�"�$��0�0rc��t|t�std|�dt|�����||j|<|j
|_y)aR
        Register a static child.

        You almost certainly don't want '/' in your path. If you
        intended to have the root of a folder, e.g. /foo/, you want
        path to be ''.

        @param path: A single path component.

        @param child: The child resource to register.

        @see: L{IResource.putChild}
        z Path segment must be bytes, but z is N)�
isinstancer'�	TypeError�typer:�server)r<r!r"s   rr#zResource.putChild�sG���$��&��>�t�h�d�4�PT�:�,�W�X�X�#��
�
�d���{�{��rc���t|dt|j�zd�}|s	|j}t
|��||�S#t$rt|�}Yt
|��wxYw)aF
        Render a given resource. See L{IResource}'s render method.

        I delegate to methods of self with the form 'render_METHOD'
        where METHOD is the HTTP that was used to make the
        request. Examples: render_GET, render_HEAD, render_POST, and
        so on. Generally you should implement those methods instead of
        overriding this one.

        render_METHOD methods are expected to return a byte string which will be
        the rendered page, unless the return value is C{server.NOT_DONE_YET}, in
        which case it is this class's responsibility to write the results using
        C{request.write(data)} and then call C{request.finish()}.

        Old code that overrides render() directly is likewise expected
        to return a byte string or NOT_DONE_YET.

        @see: L{IResource.render}
        �render_N)�getattrr�methodr7�AttributeError�_computeAllowedMethodsr)r<r�mr7s    rr&zResource.render�sp��(
�D�)�l�7�>�>�&B�B�D�I���
>�!%�!4�!4��$�N�3�3���z���"�
>�!7��!=��#�N�3�3�
>�s�A�A'�&A'c�$�|j|�S)z�
        Default handling of HEAD method.

        I just return self.render_GET(request). When method is HEAD,
        the framework will handle this correctly.
        )�
render_GETrOs  r�render_HEADzResource.render_HEADs�����w�'�'rr?)r!r'r"rr(r))r*r+r,r-r�
entityType�__annotations__rjr=r.rBrErHrKrGrJrSrWrYr\rVrrr#r&rtrrrrrmsw����J�#�#�
�F���F�*�+�F�L���'�� �%�
#�.,�$	1�#�,�:(rrc��g}t|jd�D]"}|j|jd���$|S)z�
    Compute the allowed methods on a C{Resource} based on defined render_FOO
    methods. Used when raising C{UnsupportedMethod} but C{Resource} does
    not define C{allowedMethods} attribute.
    rl�ascii)r�	__class__r3�encode)r4r7rs   rrprpsF���N�#�H�$6�$6�	�B�4��	���d�k�k�'�2�3�	4�
�rc�&�eZdZdZdZd�Zd�Zd�Zy)�_UnsafeErrorPagea�
    L{_UnsafeErrorPage}, publicly available via the deprecated alias
    C{ErrorPage}, is a resource which responds with a particular
    (parameterized) status and a body consisting of HTML containing some
    descriptive text.  This is useful for rendering simple error pages.

    Deprecated in Twisted 22.10.0 because it permits HTML injection; use
    L{twisted.web.pages.errorPage} instead.

    @ivar template: A native string which will have a dictionary interpolated
        into it to generate the response body.  The dictionary has the following
        keys:

          - C{"code"}: The status code passed to L{_UnsafeErrorPage.__init__}.
          - C{"brief"}: The brief description passed to
            L{_UnsafeErrorPage.__init__}.
          - C{"detail"}: The detailed description passed to
            L{_UnsafeErrorPage.__init__}.

    @ivar code: An integer status code which will be used for the response.
    @type code: C{int}

    @ivar brief: A short string which will be included in the response body as
        the page title.
    @type brief: C{str}

    @ivar detail: A longer string which will be included in the response body.
    @type detail: C{str}
    z�
<html>
  <head><title>%(code)s - %(brief)s</title></head>
  <body>
    <h1>%(brief)s</h1>
    <p>%(detail)s</p>
  </body>
</html>
c�X�tj|�||_||_||_yr?)rr=�code�brief�detail)r<�statusrr�s    rr=z_UnsafeErrorPage.__init__Rs%�����$����	���
���rc��|j|j�|jdd�|jt	|j|j
|j��z}t|t�r|jd�S|S)Nscontent-typestext/html; charset=utf-8)r~rr�zutf-8)
�setResponseCoder~�	setHeader�template�dictrr�rg�strrz)r<r�interpolateds   rr&z_UnsafeErrorPage.renderXsp������	�	�*����/�+F�G��}�}�t����$�*�*�T�[�[�(
�
���l�C�(��&�&�w�/�/��rc��|Sr?r)r<�chnamrs   rrVz_UnsafeErrorPage.getChildbs���rN)r*r+r,r-r�r=r&rVrrrr|r|)s���<�H���rr|c��eZdZdZdd�Zy)r^a5
    L{_UnsafeNoResource}, publicly available via the deprecated alias
    C{NoResource}, is a specialization of L{_UnsafeErrorPage} which
    returns the HTTP response code I{NOT FOUND}.

    Deprecated in Twisted 22.10.0 because it permits HTML injection; use
    L{twisted.web.pages.notFound} instead.
    c�<�tj|td|�y)NzNo Such Resource)r|r=r�r<�messages  rr=z_UnsafeNoResource.__init__ps���!�!�$�	�3E�w�OrN)z%Sorry. No luck finding that resource.�r*r+r,r-r=rrrr^r^fs
���Prr^c��eZdZdZdd�Zy)�_UnsafeForbiddenResourceaC
    L{_UnsafeForbiddenResource}, publicly available via the deprecated alias
    C{ForbiddenResource} is a specialization of L{_UnsafeErrorPage} which
    returns the I{FORBIDDEN} HTTP response code.

    Deprecated in Twisted 22.10.0 because it permits HTML injection; use
    L{twisted.web.pages.forbidden} instead.
    c�<�tj|td|�y)NzForbidden Resource)r|r=rr�s  rr=z!_UnsafeForbiddenResource.__init__~s���!�!�$�	�3G��QrN)zSorry, resource is forbidden.r�rrrr�r�ts
���Rrr��Twisted��
zEUse twisted.web.pages.errorPage instead, which properly escapes HTML.rzDUse twisted.web.pages.notFound instead, which properly escapes HTML.rzEUse twisted.web.pages.forbidden instead, which properly escapes HTML.r	c��eZdZdZd�Zy)�_IEncodingResourcezT
    A resource which knows about L{_IRequestEncoderFactory}.

    @since: 12.3
    c��y)z�
        Parse the request and return an encoder if applicable, using
        L{_IRequestEncoderFactory.encoderForRequest}.

        @return: A L{_IRequestEncoder}, or L{None}.
        Nrr%s r�
getEncoderz_IEncodingResource.getEncoder�rrN)r*r+r,r-r�rrrr�r��s���rr�c�(��eZdZdZ�fd�Zd�Z�xZS)r
a�
    Wrap a L{IResource}, potentially applying an encoding to the response body
    generated.

    Note that the returned children resources won't be wrapped, so you have to
    explicitly wrap them if you want the encoding to be applied.

    @ivar encoders: A list of
        L{_IRequestEncoderFactory<twisted.web.iweb._IRequestEncoderFactory>}
        returning L{_IRequestEncoder<twisted.web.iweb._IRequestEncoder>} that
        may transform the data passed to C{Request.write}. The list must be
        sorted in order of priority: the first encoder factory handling the
        request will prevent the others from doing the same.
    @type encoders: C{list}.

    @since: 12.3
    c�2��t�|�|�||_yr?)�superr=�	_encoders)r<�original�encodersrys   �rr=z EncodingResourceWrapper.__init__�s���
����"�!��rc�T�|jD]}|j|�}|��|cSy)zR
        Browser the list of encoders looking for one applicable encoder.
        N)r��encoderForRequest)r<r�encoderFactory�encoders    rr�z"EncodingResourceWrapper.getEncoder�s2��#�n�n�	�N�$�6�6�w�?�G��"���	r)r*r+r,r-r=r��
__classcell__)rys@rr
r
�s����$"�rr
)'r-�
__future__r�__all__rc�typingr�zope.interfacerr
r�incrementalr�twisted.python.compatr�twisted.python.componentsr�twisted.python.deprecater�twisted.python.reflectr�twisted.web._responsesrr�twisted.web.errorrrrrrpr|r^r�rrr	r*r�r
rrr�<module>r�sC��
�
#�����<�<��.�7�>�6�7�/�:�	�:�z�
�Y��i(�i(��i(�X�:�x�:�zP�(�P�R�/�R�
�	�
�
�,����I�r�2�q�!�K���	���I�r�2�q�!�J���	���I�r�2�q�!�K���	�
��
� 
�
� ��/�	�:��!�r
¿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!