a
    }3er'                     @   s  d dl Z d dlmZmZmZmZmZmZ d dlm	Z	 ddl
mZmZ ddlmZ dZG dd	 d	eeZG d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG d d! d!eZG d"d# d#eZG d$d% d%eZG d&d' d'eZ G d(d) d)eZ!G d*d+ d+eZ"G d,d- d-eZ#G d.d/ d/eZ$G d0d1 d1eZ%G d2d3 d3e%Z&G d4d5 d5e%Z'G d6d7 d7e%Z(G d8d9 d9e%Z)G d:d; d;e%Z*G d<d= d=e%Z+G d>d? d?e%Z,G d@dA dAe%Z-G dBdC dCe%Z.G dDdE dEe%Z/G dFdG dGe%Z0G dHdI dIe%Z1G dJdK dKe%Z2G dLdM dMe%Z3G dNdO dOe%Z4G dPdQ dQe%Z5G dRdS dSe%Z6G dTdU dUe%Z7G dVdW dWe%Z8G dXdY dYe%Z9G dZd[ d[e%Z:G d\d] d]e%Z;G d^d_ d_e%Z<G d`da dae%Z=G dbdc dce%Z>G ddde dee%Z?G dfdg dgeZ@G dhdi die@ZAG djdk dke@ZBG dldm dme@ZCG dndo doe@ZDG dpdq dqe@ZEG drds dse@ZFG dtdu due@ZGG dvdw dwe@ZHG dxdy dye@ZIG dzd{ d{e@ZJdS )|    N)AnyDictIterableListOptionalSet)URL   )LooseHeadersStrOrURL)Response)9HTTPException	HTTPErrorHTTPRedirectionHTTPSuccessfulHTTPOkHTTPCreatedHTTPAcceptedHTTPNonAuthoritativeInformationHTTPNoContentHTTPResetContentHTTPPartialContentHTTPMultipleChoicesHTTPMovedPermanently	HTTPFoundHTTPSeeOtherHTTPNotModifiedHTTPUseProxyHTTPTemporaryRedirectHTTPPermanentRedirectHTTPClientErrorHTTPBadRequestHTTPUnauthorizedHTTPPaymentRequiredHTTPForbiddenHTTPNotFoundHTTPMethodNotAllowedHTTPNotAcceptableHTTPProxyAuthenticationRequiredHTTPRequestTimeoutHTTPConflictHTTPGoneHTTPLengthRequiredHTTPPreconditionFailedHTTPRequestEntityTooLargeHTTPRequestURITooLongHTTPUnsupportedMediaTypeHTTPRequestRangeNotSatisfiableHTTPExpectationFailedHTTPMisdirectedRequestHTTPUnprocessableEntityHTTPFailedDependencyHTTPUpgradeRequiredHTTPPreconditionRequiredHTTPTooManyRequestsHTTPRequestHeaderFieldsTooLargeHTTPUnavailableForLegalReasonsHTTPServerErrorHTTPInternalServerErrorHTTPNotImplementedHTTPBadGatewayHTTPServiceUnavailableHTTPGatewayTimeoutHTTPVersionNotSupportedHTTPVariantAlsoNegotiatesHTTPInsufficientStorageHTTPNotExtended!HTTPNetworkAuthenticationRequiredc                   @   s\   e Zd ZdZdZdZddddddee ee e	ee ee ddddZ
ed	d
dZdS )r   FTNheadersreasonbodytextcontent_type)rH   rI   rJ   rK   rL   returnc             	   C   sd   |d urt dt tj| | j|||||d t| | j | jd u r`| j	s`| j
 d| j | _d S )Nz3body argument is deprecated for http web exceptions)statusrH   rI   rJ   rK   rL   z: )warningswarnDeprecationWarningr   __init__status_code	ExceptionrI   rJ   
empty_bodyrN   rK   )selfrH   rI   rJ   rK   rL    rW   I/home/pi/bot/my_env/lib/python3.9/site-packages/aiohttp/web_exceptions.pyrR   U   s"    		zHTTPException.__init__)rM   c                 C   s   dS )NTrW   )rV   rW   rW   rX   __bool__p   s    zHTTPException.__bool__)__name__
__module____qualname__rS   rU   Z__http_exception__r   r
   strr   rR   boolrY   rW   rW   rW   rX   r   K   s"   r   c                   @   s   e Zd ZdZdS )r   zABase class for exceptions with status codes in the 400s and 500s.NrZ   r[   r\   __doc__rW   rW   rW   rX   r   t   s   r   c                   @   s   e Zd ZdZdS )r   z8Base class for exceptions with status codes in the 300s.Nr_   rW   rW   rW   rX   r   x   s   r   c                   @   s   e Zd ZdZdS )r   z8Base class for exceptions with status codes in the 200s.Nr_   rW   rW   rW   rX   r   |   s   r   c                   @   s   e Zd ZdZdS )r      NrZ   r[   r\   rS   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r      Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r      Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r      Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdZdS )r      TNrZ   r[   r\   rS   rU   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdZdS )r      TNrg   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r      Nrb   rW   rW   rW   rX   r      s   r   c                	       sL   e Zd Zddddddeee ee eee ee dd fddZ  Z	S )	_HTTPMoveNrG   )locationrH   rI   rJ   rK   rL   rM   c                   s>   |st dt j|||||d tt|| jd< || _d S )Nz.HTTP redirects need a location to redirect to.rG   ZLocation)
ValueErrorsuperrR   r]   r   rH   rk   )rV   rk   rH   rI   rJ   rK   rL   	__class__rW   rX   rR      s    
z_HTTPMove.__init__)
rZ   r[   r\   r   r   r
   r]   r   rR   __classcell__rW   rW   rn   rX   rj      s   rj   c                   @   s   e Zd ZdZdS )r   i,  Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r   i-  Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r   i.  Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r   i/  Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdZdS )r   i0  TNrg   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r   i1  Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r   i3  Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdZdS )r   i4  Nrb   rW   rW   rW   rX   r      s   r   c                   @   s   e Zd ZdS )r    NrZ   r[   r\   rW   rW   rW   rX   r       s   r    c                   @   s   e Zd ZdZdS )r!   i  Nrb   rW   rW   rW   rX   r!      s   r!   c                   @   s   e Zd ZdZdS )r"   i  Nrb   rW   rW   rW   rX   r"      s   r"   c                   @   s   e Zd ZdZdS )r#   i  Nrb   rW   rW   rW   rX   r#      s   r#   c                   @   s   e Zd ZdZdS )r$   i  Nrb   rW   rW   rW   rX   r$      s   r$   c                   @   s   e Zd ZdZdS )r%   i  Nrb   rW   rW   rW   rX   r%      s   r%   c                
       sV   e Zd ZdZddddddeee ee ee eee ee dd fddZ	  Z
S )r&   i  NrG   )methodallowed_methodsrH   rI   rJ   rK   rL   rM   c          	         sF   d t|}t j|||||d || jd< t|| _| | _d S )N,rG   ZAllow)	joinsortedrm   rR   rH   setrs   upperrr   )	rV   rr   rs   rH   rI   rJ   rK   rL   Zallowrn   rW   rX   rR      s    

zHTTPMethodNotAllowed.__init__)rZ   r[   r\   rS   r]   r   r   r
   r   rR   rp   rW   rW   rn   rX   r&      s    r&   c                   @   s   e Zd ZdZdS )r'   i  Nrb   rW   rW   rW   rX   r'     s   r'   c                   @   s   e Zd ZdZdS )r(   i  Nrb   rW   rW   rW   rX   r(     s   r(   c                   @   s   e Zd ZdZdS )r)   i  Nrb   rW   rW   rW   rX   r)      s   r)   c                   @   s   e Zd ZdZdS )r*   i  Nrb   rW   rW   rW   rX   r*   $  s   r*   c                   @   s   e Zd ZdZdS )r+   i  Nrb   rW   rW   rW   rX   r+   (  s   r+   c                   @   s   e Zd ZdZdS )r,   i  Nrb   rW   rW   rW   rX   r,   ,  s   r,   c                   @   s   e Zd ZdZdS )r-   i  Nrb   rW   rW   rW   rX   r-   0  s   r-   c                       s,   e Zd ZdZeeedd fddZ  ZS )r.   i  N)max_sizeactual_sizekwargsrM   c                    s*   | dd|| t jf i | d S )NrK   z:Maximum request body size {} exceeded, actual body size {})
setdefaultformatrm   rR   )rV   ry   rz   r{   rn   rW   rX   rR   7  s    z"HTTPRequestEntityTooLarge.__init__)rZ   r[   r\   rS   floatr   rR   rp   rW   rW   rn   rX   r.   4  s   r.   c                   @   s   e Zd ZdZdS )r/   i  Nrb   rW   rW   rW   rX   r/   @  s   r/   c                   @   s   e Zd ZdZdS )r0   i  Nrb   rW   rW   rW   rX   r0   D  s   r0   c                   @   s   e Zd ZdZdS )r1   i  Nrb   rW   rW   rW   rX   r1   H  s   r1   c                   @   s   e Zd ZdZdS )r2   i  Nrb   rW   rW   rW   rX   r2   L  s   r2   c                   @   s   e Zd ZdZdS )r3   i  Nrb   rW   rW   rW   rX   r3   P  s   r3   c                   @   s   e Zd ZdZdS )r4   i  Nrb   rW   rW   rW   rX   r4   T  s   r4   c                   @   s   e Zd ZdZdS )r5   i  Nrb   rW   rW   rW   rX   r5   X  s   r5   c                   @   s   e Zd ZdZdS )r6   i  Nrb   rW   rW   rW   rX   r6   \  s   r6   c                   @   s   e Zd ZdZdS )r7   i  Nrb   rW   rW   rW   rX   r7   `  s   r7   c                   @   s   e Zd ZdZdS )r8   i  Nrb   rW   rW   rW   rX   r8   d  s   r8   c                   @   s   e Zd ZdZdS )r9   i  Nrb   rW   rW   rW   rX   r9   h  s   r9   c                	       sP   e Zd ZdZddddddeee ee eee ee dd fddZ  Z	S )r:   i  NrG   )linkrH   rI   rJ   rK   rL   rM   c                   s.   t  j|||||d d| | jd< || _d S )NrG   z<%s>; rel="blocked-by"Link)rm   rR   rH   r   )rV   r   rH   rI   rJ   rK   rL   rn   rW   rX   rR   o  s    
z'HTTPUnavailableForLegalReasons.__init__)
rZ   r[   r\   rS   r]   r   r
   r   rR   rp   rW   rW   rn   rX   r:   l  s   r:   c                   @   s   e Zd ZdS )r;   Nrq   rW   rW   rW   rX   r;     s   r;   c                   @   s   e Zd ZdZdS )r<   i  Nrb   rW   rW   rW   rX   r<     s   r<   c                   @   s   e Zd ZdZdS )r=   i  Nrb   rW   rW   rW   rX   r=     s   r=   c                   @   s   e Zd ZdZdS )r>   i  Nrb   rW   rW   rW   rX   r>     s   r>   c                   @   s   e Zd ZdZdS )r?   i  Nrb   rW   rW   rW   rX   r?     s   r?   c                   @   s   e Zd ZdZdS )r@   i  Nrb   rW   rW   rW   rX   r@     s   r@   c                   @   s   e Zd ZdZdS )rA   i  Nrb   rW   rW   rW   rX   rA     s   rA   c                   @   s   e Zd ZdZdS )rB   i  Nrb   rW   rW   rW   rX   rB     s   rB   c                   @   s   e Zd ZdZdS )rC   i  Nrb   rW   rW   rW   rX   rC     s   rC   c                   @   s   e Zd ZdZdS )rD   i  Nrb   rW   rW   rW   rX   rD     s   rD   c                   @   s   e Zd ZdZdS )rE   i  Nrb   rW   rW   rW   rX   rE     s   rE   )KrO   typingr   r   r   r   r   r   Zyarlr   Ztypedefsr
   r   Zweb_responser   __all__rT   r   r   r   r   r   r   r   r   r   r   r   rj   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rW   rW   rW   rX   <module>   s~    B)		$