;idddlmZddlZddlZddlmZddlmZddlm Z ddlm Z ej rddl m Z dd lmZdd lmZd d lmZd d lmZGddeZGddeeZGddeZGddeZGddeeZGddeZGddeZdS)) annotationsN) BadRequest) HTTPException)cached_property)redirect)WSGIEnvironment)Request)Response) MapAdapter)RuleceZdZdZdS)RoutingExceptionzxSpecial exceptions that require the application to redirect, notifying about missing urls, etc. :internal: N__name__ __module__ __qualname____doc__OC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\werkzeug/routing/exceptions.pyrrsrrc6eZdZdZdZdfd Z dddZxZS)RequestRedirectzRaise if the map requests a redirect. This is for example the case if `strict_slashes` are activated and an url that requires a trailing slash. The attribute `new_url` contains the absolute destination url. i4new_urlstrreturnNonecXt|||_dSN)super__init__r)selfr __class__s rr"zRequestRedirect.__init__%s& !!! rNenviron WSGIEnvironment | Request | Nonescopedict[str, t.Any] | Noner c6t|j|jSr )rrcode)r#r%r's r get_responsezRequestRedirect.get_response)s  di000r)rrrr)NN)r%r&r'r(rr )rrrrr*r"r+ __classcell__r$s@rrrso D 59)-111111111rrc(eZdZdZdZdfd ZxZS) RequestPathzInternal exception.) path_infor0rrrcVt||_dSr )r!r"r0)r#r0r$s rr"zRequestPath.__init__6s$ "r)r0rrr)rrrr __slots__r"r,r-s@rr/r/1sHI##########rr/c$eZdZdZd fd ZxZS) RequestAliasRedirectzAThis rule is an alias and wants to redirect to the canonical URL.matched_valuest.Mapping[str, t.Any]endpointt.Anyrrcdt||_||_dSr )r!r"r5r7)r#r5r7r$s rr"zRequestAliasRedirect.__init__>s, ,  r)r5r6r7r8rr)rrrrr"r,r-s@rr4r4;sCKK!!!!!!!!!!rr4cPeZdZdZ ddfd ZeddZddZddZxZ S) BuildErrorz_Raised if the build system cannot find a URL for an endpoint with the values provided. Nr7r8valuesr6method str | NoneadapterMapAdapter | Nonerrct|||||_||_||_||_dSr )r!r"r7r<r=r?)r#r7r<r=r?r$s rr"zBuildError.__init__IsA 66222     r Rule | Nonec6||jSr ) closest_ruler?)r#s r suggestedzBuildError.suggestedVs  ...rcfdfd }|r'|jjrt|jj|SdS)Nrulerrfloatc tdtjdt|jtjzdt tjpd |j zdt |j o j |j vzgS)Ng\(\?g{Gz?r) sumdifflibSequenceMatcherrr7ratioboolsetr<issubset argumentsmethodsr=)rGr#s r _score_rulez,BuildError.closest_rule.._score_rule[s-DM**DM**  egg 4DK$52 6 6 ? ? O OPPP4 L 1LMMM    r)key)rGrrrH)map_rulesmax)r#r?rSs` rrDzBuildError.closest_ruleZsT        +>BB C C Cs > V} 777K.: 4>+AAANN@"4>#9::@@@"&!9!?!?/5266"" ((**++","NNXVN=S=SXXXT0GTTTUUUwwwrr ) r7r8r<r6r=r>r?r@rr)rrB)r?r@rrB)rr) rrrrr"rrErDrer,r-s@rr;r;Ds&*       ///_/*        rr;ceZdZdZdS)WebsocketMismatchzThe only matched rule is either a WebSocket and the request is HTTP, or the rule is HTTP and the request is a WebSocket. NrrrrrgrgsrrgceZdZdZd dZd S) NoMatchhave_match_forwebsocket_mismatchrkset[str]rlrNrrc"||_||_dSr rj)r#rkrls rr"zNoMatch.__init__s,"4rN)rkrmrlrNrr)rrrr2r"rrrriris-8I555555rri) __future__rrKtypingt exceptionsrrutilsrr TYPE_CHECKING_typeshed.wsgir wrappers.requestr wrappers.responser rUr rulesr Exceptionrrr/r4 LookupErrorr;rgrirrrr{s""""""######&&&&&&######?......******,,,,,,y11111m%5111*#####"###!!!!!+!!!F F F F F !;F F F R  55555i55555r