ó
    ×›‘hÃ  ã                   ó¾   • S r SrSSKJr  SSKJr  SSKJrJr  SSK	J
r
Jr  SSKJrJr   " S S	\5      rS
\S\S\S\4S jr  SS\S\S\
4S jjr SS\S\S\
4S jjrg)z*
Utility implementations of L{IResource}.
)Ú	errorPageÚnotFoundÚ	forbiddené    )Úcast)Úhttp)ÚIRenderableÚIRequest)Ú	IResourceÚResource)ÚrenderElementÚtagsc                   óh   ^ • \ rS rSrSrS\S\S\SS4U 4S jjrS	\S\	4S
 jr
S\S	\S\4S jrSrU =r$ )Ú
_ErrorPageé   aù  
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                 óF   >• [         TU ]  5         Xl        X l        X0l        g )N)ÚsuperÚ__init__Ú_codeÚ_briefÚ_detail)Úselfr   r   r   Ú	__class__s       €ÚUC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/web/pages.pyr   Ú_ErrorPage.__init__(   s   ø€ Ü‰ÑÔØŒ
Ø ŒØ"�ó    Úrequestc                 óÞ  • UR                  U R                  5        UR                  SS5        [        U[	        [
        [        R                  " [        R                  " [        R                  " U R                   SU R                   35      5      [        R                  " [        R                  " U R                  5      [        R                  " U R                  5      5      5      5      5      $ )zr
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   ÚrenderÚ_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                 ó   • U $ )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   ÚgetChildÚ_ErrorPage.getChildC   s	   € ð ˆr   )r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚintÚstrr   r	   Úobjectr*   Úbytesr   r/   Ú__static_attributes__Ú__classcell__)r   s   @r   r   r      s[   ø† ñð #˜Sð #¨ð #°cð #¸d÷ #ð
˜hð 
¨6ô 
ð*	˜Uð 	¨Xð 	¸(÷ 	ò 	r   r   r   r   r   r   c                 ó   • [        XU5      $ )aF  
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 6Ó*Ð*r   Úmessagec                 ó6   • [        [        R                  X5      $ )zõ
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 message: A longer string displayed in the page body.

@returns: An L{IResource}
)r   r   Ú	NOT_FOUND©r   r=   s     r   r   r   f   s   € ô ”d—n‘n eÓ5Ð5r   c                 ó6   • [        [        R                  X5      $ )zõ
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 message: A longer string displayed in the page body.

@returns: An L{IResource}
)r   r   Ú	FORBIDDENr@   s     r   r   r   x   s   € ô ”d—n‘n eÓ5Ð5r   N)zNo Such Resourcez%Sorry. No luck finding that resource.)zForbidden ResourcezSorry, resource is forbidden.)r5   Ú__all__Útypingr   Útwisted.webr   Útwisted.web.iwebr   r	   Útwisted.web.resourcer
   r   Útwisted.web.templater   r   r   r6   r7   r   r   r   r.   r   r   Ú<module>rI      sš   ðñ
ð€õ å ß 2ß 4ß 4ô5�ô 5ðp+�Cð + ð +¨Sð +°Zô +ð0 $Ø:ñ6Øð6àð6ð õ6ð& 7Vñ6Øð6Ø03ð6àö6r   