5,j#zUddlmZddlZddlZddlmZddlmZddlmZddl m Z m Z m Z ddl mZdd lmZdd lmZdd lmZmZdd lmZd dlmZmZmZmZd dlmZd dlmZm Z ej!rddlm"Z"m#Z#GddZ$Gdde$Z%ej!r$e$ddZ&de'd<e%ddZ(de'd<dSdS)) annotationsN) HTTPException)ResponseNotReady) _TYPE_BODY)HTTPConnection ProxyConfigport_by_scheme) TimeoutError)BaseHTTPResponse)_TYPE_SOCKET_OPTIONS)_DEFAULT_TIMEOUT _TYPE_TIMEOUT)Url) _RequestError _TimeoutError send_requestsend_streaming_request)EmscriptenRequest)EmscriptenHttpResponseWrapperEmscriptenResponse)BaseHTTPConnectionBaseHTTPSConnectionc^eZdZUedZded<ded<ded<ded <d ed <d ed <d ed<ded<ded<ded<dZded<dZded<eZ ded<ded< d=e dd dddd!d>d%Z d?d@d*Z dAd+Z dBdd,d,d,d-dCd6ZdDd8ZdAd9ZedEd:ZedEd;ZedEd<ZdS)FEmscriptenHTTPConnectionhttpztyping.ClassVar[int] default_portz%typing.ClassVar[_TYPE_SOCKET_OPTIONS]default_socket_optionsz None | floattimeoutstrhostintport blocksizetuple[str, int] | Nonesource_address_TYPE_SOCKET_OPTIONS | Nonesocket_options Url | NoneproxyProxyConfig | None proxy_configFbool is_verifiedNz bool | Noneproxy_is_verifiedztype[BaseHTTPResponse]response_classzEmscriptenResponse | None _responseri )r r'r%r)r+r-rreturnNonec||_||_t|tr|nd|_d|_d|_d|_d|_d|_ ||_ d|_ d|_ d|_ dS)NgrTF)r"r$ isinstancefloatr scheme_closedr2r+r-r%r'r)r/) selfr"r$r r'r%r)r+r-s UC:\PYTHON\GemmaClient\venv\Lib\site-packages\urllib3/contrib/emscripten/connection.py__init__z!EmscriptenHTTPConnection.__init__.sw  ",We"<"<Eww#     """  int | Noneheaderstyping.Mapping[str, str] | Noner8cdSN)r:r"r$r?r8s r; set_tunnelz#EmscriptenHTTPConnection.set_tunnelIs  r=cdSrBrCr:s r;connectz EmscriptenHTTPConnection.connectRs r=T)chunkedpreload_contentdecode_contentenforce_content_lengthmethodurlbody_TYPE_BODY | NonerHrIrJrKchd|_|dr)|j d|j} nd} |jd|j| |}t |||jr|jnd|} | ||r0|D]\} } | | | d|_ |st| |_ |j t| |_ dSdS#t$r} t| j| d} ~ wt $r} t#| j| d} ~ wwxYw)NF/:z://r)rMrLr rJ)r9 startswithr$r8r"rr set_bodyitems set_headerr2rrrr messagerr)r:rLrMrNr?rHrIrJrKr$requestkves r;rYz EmscriptenHTTPConnection.requestUs{ >>#   <y$&49[;;TY;;c;;C#$(L7DLLa)       )  ) )1""1a(((( 2" A!7!@!@~%!-g!6!6&% 1 1 1qy))q 0 2 2 2 ** 1 2s$61C++ D15D  D1D,,D1r cx|j&t|j|jjj|St )N)internal_responserM connection)r2rrYrMrrFs r; getresponsez$EmscriptenHTTPConnection.getresponsesB > %0"&.N*.  #$$ $r=c"d|_d|_dS)NT)r9r2rFs r;closezEmscriptenHTTPConnection.closes r=c|jS)zWhether the connection either is brand new or has been previously closed. If this property is True then both ``is_connected`` and ``has_connected_to_proxy`` properties must be False. )r9rFs r; is_closedz"EmscriptenHTTPConnection.is_closeds |r=cdS)zLWhether the connection is actively connected to any origin (proxy or target)TrCrFs r; is_connectedz%EmscriptenHTTPConnection.is_connecteds tr=cdS)zWhether the connection has successfully connected to its proxy. This returns False if no proxy is in use. Used to determine whether errors are coming from the proxy layer or from tunnelling to the target origin. FrCrFs r;has_connected_to_proxyz/EmscriptenHTTPConnection.has_connected_to_proxys ur=r)r"r!r$r#r rr'r&r%r#r)r(r+r*r-r,r3r4)rNr) r"r!r$r>r?r@r8r!r3r4)r3r4)NN)rLr!rMr!rNrOr?r@rHr.rIr.rJr.rKr.r3r4)r3r )r3r.)__name__ __module__ __qualname__r r__annotations__r/r0rr1rr<rDrGrYr`rbpropertyrdrfrhrCr=r;rrs)7)?L????AAAA III IIINNN****////$$$$K%)))))-JNJJJJ(((( ! "2156: +/!!!!!!<37          #'37 *2 $#'+*2*2*2*2*2*2X%%%%XXXr=rc*eZdZUedZdZded<dZded<dZded<dZ ded <ded <ded <ded <d ed<dZ ded<dZ ded<dZ ded<ded<dZ ded< d-eddejdddddddddddddddddd.fd+Z d/d0d,ZxZS)1EmscriptenHTTPSConnectionhttpsNint | str | None cert_reqs str | Noneca_certs ca_cert_dirNone | str | bytes ca_cert_data cert_filekey_file key_passwordtyping.Any | None ssl_context ssl_versionr>ssl_minimum_versionssl_maximum_version"None | str | typing.Literal[False]assert_hostnameassert_fingerprintri@)r r'r%r)r+r-rsrrserver_hostnamer}rurvrxrrr~ryrzr{r"r!r$r#r rr'r&r%r)None | _TYPE_SOCKET_OPTIONSr+r*r-r,rr3r4c t||||||||d|_||_||_||_| |_| |_| |_| |_ ||_ ||_ ||_ |otj||_|otj||_||_d|_d|_dS)N)r$r r'r%r)r+r-rqT)superr<r8rzryr{r}rrrr~rrospath expanduserrurvrxrsr/)r:r"r$r r'r%r)r+r-rsrrrr}rurvrxrrr~ryrzr{ __class__s r;r<z"EmscriptenHTTPSConnection.__init__s8  ))%     "(&.."4&#6 #6  ARW%7%7%A%A &J27+=+=k+J+J( r=c dSrBrC) r:rzryrsr{rurrrvrxs r;set_certz"EmscriptenHTTPSConnection.set_certs  r=ri).r"r!r$r#r rr'r&r%r#r)rr+r*r-r,rsrrrrrrtrrtr}r|rurtrvrtrxrwrr>rr>r~rrryrtrzrtr{rtr3r4) NNNNNNNNN)rzrtryrtrsrrr{rtrurtrrrrtrvrtrxrwr3r4)rjrkrlr rrsrmrurvrxr~rrrrrrr<r __classcell__)rs@r;rprps!'*L"&I&&&&H"K""""'+L++++""""$(K((((&*****&*****7777%))))) : "215  1 +/&*>B)-&*)-#"&+/*.*.(, $##'5: : : : : : : : | $ $&*#'#>B)-"&+/          r=rprSr_supports_http_protocolr_supports_https_protocol)) __future__rrtyping http.clientrr_base_connectionrr_rr r exceptionsr responser util.connectionr util.timeoutrrutil.urlrfetchrrrrrYrrr TYPE_CHECKINGrrrrprrmrrCr=r;rs""""""" 766666((((((******EEEEEEEEEE&&&&&&((((((333333;;;;;;;;UUUUUUUUUUUU&&&&&&GGGGGGGG LKKKKKKKKIIIIIIIIXY Y Y Y Y 8Y Y Y z U2J2J2q2Q2QQQQQ4M4MbRS4T4TTTTTTTUUr=