§
    Ètºf¿  ã                   ó¼   — d Z dZddlmZ ddlmZ ddlmZmZ ddl	m
Z
mZ ddlmZmZ  G d„ d	e¦  «        Zd
edededefd„Z	 	 ddedede
fd„Z	 ddedede
fd„ZdS )z*
Utility implementations of L{IResource}.
)Ú	errorPageÚnotFoundÚ	forbiddené    )Úcast)Úhttp)ÚIRenderableÚIRequest)Ú	IResourceÚResource)ÚrenderElementÚtagsc                   óX   ‡ — e Zd ZdZdedededdfˆ fd„Zdedefd	„Z	d
e
dedefd„Zˆ xZ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                 ór   •— t          ¦   «                              ¦   «          || _        || _        || _        d S )N)ÚsuperÚ__init__Ú_codeÚ_briefÚ_detail)Úselfr   r   r   Ú	__class__s       €úP/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/web/pages.pyr   z_ErrorPage.__init__(   s2   ø€ Ý‰Œ×ÒÑÔÐØˆŒ
Ø ˆŒØ"ˆŒˆˆó    Úrequestc                 ó¶  — |                      | j        ¦  «         |                     dd¦  «         t          |t	          t
          t          j        t          j        t          j	        | j        › d| j
        › �¦  «        ¦  «        t          j        t          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-types   text/html; charset=utf-8z - )ÚsetResponseCoder   Ú	setHeaderr   r   r   r   ÚhtmlÚheadÚtitler   ÚbodyÚh1Úpr   )r   r   s     r   Úrenderz_ErrorPage.render.   s·   € ð
 	×Ò ¤
Ñ+Ô+Ð+Ø×Ò˜/Ð+FÑGÔGÐGÝØõ ÝÝ”	Ý”I�dœj¨D¬JÐ)HÐ)H¸4¼;Ð)HÐ)HÑIÔIÑJÔJÝ”I�dœg d¤kÑ2Ô2µD´F¸4¼<Ñ4HÔ4HÑIÔ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
        © )r   r)   r   s      r   ÚgetChildz_ErrorPage.getChildC   s	   € ð ˆr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚintÚstrr   r	   Úobjectr(   Úbytesr   r,   Ú__classcell__)r   s   @r   r   r      s®   ø€ € € € € ðð ð #˜Sð #¨ð #°cð #¸dð #ð #ð #ð #ð #ð #ð
˜hð 
¨6ð 
ð 
ð 
ð 
ð*	˜Uð 	¨Xð 	¸(ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	r   r   r   r   r   r   c                 ó$   — 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   )r   r   r   s      r   r   r   O   s   € õ( �d˜E 6Ñ*Ô*Ð*r   úNo Such Resourceú%Sorry. No luck finding that resource.Úmessagec                 ó8   — t          t          j        | |¦  «        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}
    )r   r   Ú	NOT_FOUND©r   r9   s     r   r   r   f   s   € õ •d”n e¨WÑ5Ô5Ð5r   úForbidden ResourceúSorry, resource is forbidden.c                 ó8   — t          t          j        | |¦  «        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}
    )r   r   Ú	FORBIDDENr<   s     r   r   r   x   s   € õ •d”n e¨WÑ5Ô5Ð5r   N)r7   r8   )r=   r>   )r0   Ú__all__Útypingr   Útwisted.webr   Útwisted.web.iwebr   r	   Útwisted.web.resourcer
   r   Útwisted.web.templater   r   r   r1   r2   r   r   r   r+   r   r   ú<module>rG      s[  ðð
ð ð€ð Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4Ð 4ð5ð 5ð 5ð 5ð 5�ñ 5ô 5ð 5ðp+�Cð + ð +¨Sð +°Zð +ð +ð +ð +ð0 $Ø:ð6ð 6Øð6àð6ð ð6ð 6ð 6ð 6ð& 7Vð6ð 6Øð6Ø03ð6àð6ð 6ð 6ð 6ð 6ð 6r   