U '7`z'@sddlZddlmZmZmZmZmZmZddlm Z ddl m Z m Z ddl mZdZGdd d eeZGd d d eZGd d d eZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGd d!d!eZGd"d#d#eZGd$d%d%eZGd&d'd'eZ Gd(d)d)eZ!Gd*d+d+eZ"Gd,d-d-eZ#Gd.d/d/eZ$Gd0d1d1eZ%Gd2d3d3e%Z&Gd4d5d5e%Z'Gd6d7d7e%Z(Gd8d9d9e%Z)Gd:d;d;e%Z*Gdd?d?e%Z,Gd@dAdAe%Z-GdBdCdCe%Z.GdDdEdEe%Z/GdFdGdGe%Z0GdHdIdIe%Z1GdJdKdKe%Z2GdLdMdMe%Z3GdNdOdOe%Z4GdPdQdQe%Z5GdRdSdSe%Z6GdTdUdUe%Z7GdVdWdWe%Z8GdXdYdYe%Z9GdZd[d[e%Z:Gd\d]d]e%Z;Gd^d_d_e%ZGdddedee%Z?GdfdgdgeZ@Gdhdidie@ZAGdjdkdke@ZBGdldmdme@ZCGdndodoe@ZDGdpdqdqe@ZEGdrdsdse@ZFGdtdudue@ZGGdvdwdwe@ZHGdxdydye@ZIGdzd{d{e@ZJdS)|N)AnyDictIterableListOptionalSet)URL) LooseHeadersStrOrURL)Response)9 HTTPException HTTPErrorHTTPRedirectionHTTPSuccessfulHTTPOk HTTPCreated HTTPAcceptedHTTPNonAuthoritativeInformation HTTPNoContentHTTPResetContentHTTPPartialContentHTTPMultipleChoicesHTTPMovedPermanently HTTPFound HTTPSeeOtherHTTPNotModified HTTPUseProxyHTTPTemporaryRedirectHTTPPermanentRedirectHTTPClientErrorHTTPBadRequestHTTPUnauthorizedHTTPPaymentRequired HTTPForbidden HTTPNotFoundHTTPMethodNotAllowedHTTPNotAcceptableHTTPProxyAuthenticationRequiredHTTPRequestTimeout HTTPConflictHTTPGoneHTTPLengthRequiredHTTPPreconditionFailedHTTPRequestEntityTooLargeHTTPRequestURITooLongHTTPUnsupportedMediaTypeHTTPRequestRangeNotSatisfiableHTTPExpectationFailedHTTPMisdirectedRequestHTTPUnprocessableEntityHTTPFailedDependencyHTTPUpgradeRequiredHTTPPreconditionRequiredHTTPTooManyRequestsHTTPRequestHeaderFieldsTooLargeHTTPUnavailableForLegalReasonsHTTPServerErrorHTTPInternalServerErrorHTTPNotImplementedHTTPBadGatewayHTTPServiceUnavailableHTTPGatewayTimeoutHTTPVersionNotSupportedHTTPVariantAlsoNegotiatesHTTPInsufficientStorageHTTPNotExtended!HTTPNetworkAuthenticationRequiredc@s\eZdZdZdZdZddddddeeeee eeeeddddZ e d d d Z dS) r FTNheadersreasonbodytext content_type)rHrIrJrKrLreturnc Csd|dk rtdttj||j|||||dt||j|jdkr`|j s`|j d|j|_ dS)Nz3body argument is deprecated for http web exceptions)statusrHrIrJrKrLz: ) warningswarnDeprecationWarningr __init__ status_code ExceptionrIrJ empty_bodyrNrK)selfrHrIrJrKrLrWI/opt/alt/python38/lib64/python3.8/site-packages/aiohttp/web_exceptions.pyrRUs"  zHTTPException.__init__)rMcCsdS)NTrW)rVrWrWrX__bool__pszHTTPException.__bool__) __name__ __module__ __qualname__rSrUZ__http_exception__rr strrrRboolrYrWrWrWrXr Ks" r c@seZdZdZdS)rzABase class for exceptions with status codes in the 400s and 500s.NrZr[r\__doc__rWrWrWrXrtsrc@seZdZdZdS)rz8Base class for exceptions with status codes in the 300s.Nr_rWrWrWrXrxsrc@seZdZdZdS)rz8Base class for exceptions with status codes in the 200s.Nr_rWrWrWrXr|src@seZdZdZdS)rNrZr[r\rSrWrWrWrXrsrc@seZdZdZdS)rNrbrWrWrWrXrsrc@seZdZdZdS)rNrbrWrWrWrXrsrc@seZdZdZdS)rNrbrWrWrWrXrsrc@seZdZdZdZdS)rTNrZr[r\rSrUrWrWrWrXrsrc@seZdZdZdZdS)rTNrgrWrWrWrXrsrc@seZdZdZdS)rNrbrWrWrWrXrsrc sLeZdZddddddeeeeeeeeeeddfddZZ S) _HTTPMoveNrG)locationrHrIrJrKrLrMcs>|s tdtj|||||dtt||jd<||_dS)Nz.HTTP redirects need a location to redirect to.rGZLocation) ValueErrorsuperrRr]rrHrk)rVrkrHrIrJrKrL __class__rWrXrRs z_HTTPMove.__init__) rZr[r\r rr r]rrR __classcell__rWrWrnrXrjsrjc@seZdZdZdS)ri,NrbrWrWrWrXrsrc@seZdZdZdS)ri-NrbrWrWrWrXrsrc@seZdZdZdS)ri.NrbrWrWrWrXrsrc@seZdZdZdS)ri/NrbrWrWrWrXrsrc@seZdZdZdZdS)ri0TNrgrWrWrWrXrsrc@seZdZdZdS)ri1NrbrWrWrWrXrsrc@seZdZdZdS)ri3NrbrWrWrWrXrsrc@seZdZdZdS)ri4NrbrWrWrWrXrsrc@s eZdZdS)r NrZr[r\rWrWrWrXr sr c@seZdZdZdS)r!iNrbrWrWrWrXr!sr!c@seZdZdZdS)r"iNrbrWrWrWrXr"sr"c@seZdZdZdS)r#iNrbrWrWrWrXr#sr#c@seZdZdZdS)r$iNrbrWrWrWrXr$sr$c@seZdZdZdS)r%iNrbrWrWrWrXr%sr%c sVeZdZdZddddddeeeeeeeeeeeeddfddZ Z S)r&iNrG)methodallowed_methodsrHrIrJrKrLrMc sFdt|}tj|||||d||jd<t||_||_dS)N,rGZAllow) joinsortedrmrRrHsetrsupperrr) rVrrrsrHrIrJrKrLZallowrnrWrXrRs   zHTTPMethodNotAllowed.__init__) rZr[r\rSr]rrr rrRrprWrWrnrXr&s r&c@seZdZdZdS)r'iNrbrWrWrWrXr'sr'c@seZdZdZdS)r(iNrbrWrWrWrXr(sr(c@seZdZdZdS)r)iNrbrWrWrWrXr) sr)c@seZdZdZdS)r*iNrbrWrWrWrXr*$sr*c@seZdZdZdS)r+iNrbrWrWrWrXr+(sr+c@seZdZdZdS)r,iNrbrWrWrWrXr,,sr,c@seZdZdZdS)r-iNrbrWrWrWrXr-0sr-cs,eZdZdZeeeddfdd ZZS)r.iN)max_size actual_sizekwargsrMc s&|dd||tjf|dS)NrKz:Maximum request body size {} exceeded, actual body size {}) setdefaultformatrmrR)rVryrzr{rnrWrXrR7sz"HTTPRequestEntityTooLarge.__init__)rZr[r\rSfloatrrRrprWrWrnrXr.4sr.c@seZdZdZdS)r/iNrbrWrWrWrXr/@sr/c@seZdZdZdS)r0iNrbrWrWrWrXr0Dsr0c@seZdZdZdS)r1iNrbrWrWrWrXr1Hsr1c@seZdZdZdS)r2iNrbrWrWrWrXr2Lsr2c@seZdZdZdS)r3iNrbrWrWrWrXr3Psr3c@seZdZdZdS)r4iNrbrWrWrWrXr4Tsr4c@seZdZdZdS)r5iNrbrWrWrWrXr5Xsr5c@seZdZdZdS)r6iNrbrWrWrWrXr6\sr6c@seZdZdZdS)r7iNrbrWrWrWrXr7`sr7c@seZdZdZdS)r8iNrbrWrWrWrXr8dsr8c@seZdZdZdS)r9iNrbrWrWrWrXr9hsr9c sPeZdZdZddddddeeeeeeeeeeddfddZZ S)r:iNrG)linkrHrIrJrKrLrMcs.tj|||||dd||jd<||_dS)NrGz<%s>; rel="blocked-by"ZLink)rmrRrHr)rVrrHrIrJrKrLrnrWrXrRos z'HTTPUnavailableForLegalReasons.__init__) rZr[r\rSr]rr rrRrprWrWrnrXr:lsr:c@s eZdZdS)r;NrqrWrWrWrXr;sr;c@seZdZdZdS)r<iNrbrWrWrWrXr<sr<c@seZdZdZdS)r=iNrbrWrWrWrXr=sr=c@seZdZdZdS)r>iNrbrWrWrWrXr>sr>c@seZdZdZdS)r?iNrbrWrWrWrXr?sr?c@seZdZdZdS)r@iNrbrWrWrWrXr@sr@c@seZdZdZdS)rAiNrbrWrWrWrXrAsrAc@seZdZdZdS)rBiNrbrWrWrWrXrBsrBc@seZdZdZdS)rCiNrbrWrWrWrXrCsrCc@seZdZdZdS)rDiNrbrWrWrWrXrDsrDc@seZdZdZdS)rEiNrbrWrWrWrXrEsrE)KrOtypingrrrrrrZyarlrZtypedefsr r Z web_responser __all__rTr rrrrrrrrrrrjrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErWrWrWrXs~   B)   $