Viewing File: /opt/alt/python38/lib64/python3.8/urllib/__pycache__/parse.cpython-38.opt-2.pyc

U

,a@sddlZddlZddlZddlZdddddddd	d
ddd
dddddddddgZdddddddddd d!d"d#d$d%d&d'd(d)gZdddddd*dddd!dd d+d"d#d$d,d&d'd%d-d.d/d(d)gZddd0d"dddd d#d$d1d2d!d%d3gZdd0d4d5d*ddd+d1d2g
Zdddddd d!dd#d$d1d2gZ	ddd0ddd5dddd d+dd"g
Z
d6Zd7d8d9gZd:Z
iZd;d<Zd=Zd>Zd?d@ZeefdAdBZeefdCdDZdEdFZGdGdHdHeZGdIdJdJeZGdKdLdLeZGdMdNdNeeZGdOdPdPeeZddQlmZeddRZeddSZeddTZdUe_ dVej!_ dWej"_ dXe_ dYej#_ dZej$_ d[ej%_ d\ej&_ d]ej"_ d^e_ ej#j ej#_ ej$j ej$_ ej%j ej%_ d_ej'_ ej&j ej&_ ej"j ej"_ eZ(Gd`ddeeZ)GdaddeeZ*GdbddeeZ+GdcddeeZ,GddddeeZ-GdeddeeZ.dfdgZ/e/[/ddidZ0djdkZ1ddldmZ2dndoZ3dpdqZ4ddrdZ5dsdZ6dtdZ7ddudZ8dvdZ9dwZ:da;dxdZ<e=dyZ>dd|dZ?ddd	Z@ddd
ZAdddZBeCdZDeEeDZFiZGGdddejHZIdddZJdddZKddd
ZLd}dddeKfddZMddZNddZOddZPddZQdaRddZSddZTdaUddZVddZWddZXddZYddZZddZ[da\ddZ]dddZ^dddZ_ddZ`ddZaddZbddZcddZdddZeddZfddZgdS)Nurlparse
urlunparseurljoin	urldefragurlsplit
urlunsplit	urlencodeparse_qs	parse_qslquote
quote_plusquote_from_bytesunquoteunquote_plusunquote_to_bytesDefragResultParseResultSplitResultDefragResultBytesParseResultBytesSplitResultBytesZftphttpZgopherZnntpZimapZwaisfileZhttpsZshttpZmmsZprosperoZrtspZrtspuZsftpZsvnzsvn+sshZwsZwssZtelnetZsnewsZrsyncZnfsZgitzgit+sshZhdlZsipZsipsZtelZmailtoZnewszAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.	

cCsttdSN)_parse_cacheclear
_safe_quotersr"r"1/opt/alt/python38/lib64/python3.8/urllib/parse.pyclear_cacheWsr$asciistrictcCs|Srr")objr"r"r#_noopfsr(cCs|||Srencode)r'encodingerrorsr"r"r#_encode_resultisr-cstfdd|DS)Nc3s"|]}|r|ndVqdS)rNdecode.0xr+r,r"r#	<genexpr>osz_decode_args.<locals>.<genexpr>)tuple)argsr+r,r"r3r#_decode_argsmsr7cGsVt|dt}|ddD]}|rt|t|krtdq|rH|tfSt|tfS)Nrz$Cannot mix str and non-str arguments)
isinstancestr	TypeErrorr(r7r-)r6Z	str_inputargr"r"r#_coerce_argsqs

r=c@seZdZdZdddZdS)_ResultMixinStrr"r%r&cs|jfdd|DS)Nc3s|]}|VqdSrr)r0r3r"r#r4sz)_ResultMixinStr.encode.<locals>.<genexpr>)_encoded_counterpartselfr+r,r"r3r#r*sz_ResultMixinStr.encodeN)r%r&)__name__
__module____qualname__	__slots__r*r"r"r"r#r>sr>c@seZdZdZdddZdS)_ResultMixinBytesr"r%r&cs|jfdd|DS)Nc3s|]}|VqdSrr.r0r3r"r#r4sz+_ResultMixinBytes.decode.<locals>.<genexpr>)_decoded_counterpartr@r"r3r#r/sz_ResultMixinBytes.decodeN)r%r&)rBrCrDrEr/r"r"r"r#rFsrFc@s@eZdZdZeddZeddZeddZedd	Zd
S)_NetlocResultMixinBaser"cCs
|jdS)Nr	_userinforAr"r"r#usernamesz_NetlocResultMixinBase.usernamecCs
|jdS)Nr8rIrKr"r"r#passwordsz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|tr dnd}||\}}}|||S)Nr%%)	_hostinfor9r:	partitionlower)rAhostname	separatorZpercentZzoner"r"r#rSs
z_NetlocResultMixinBase.hostnamecCsl|jd}|dk	rhzt|d}Wn(tk
rHd|}t|dYnXd|kr^dkshntd|S)Nr8
z+Port could not be cast to integer value as rizPort out of range 0-65535)rPint
ValueError)rAportmessager"r"r#rXs

z_NetlocResultMixinBase.portN)	rBrCrDrEpropertyrLrMrSrXr"r"r"r#rHs



rHc@s(eZdZdZeddZeddZdS)_NetlocResultMixinStrr"cCsD|j}|d\}}}|r4|d\}}}|s<d}nd}}||fS)N@:netloc
rpartitionrQrAr_ZuserinfoZ	have_infohostinforLZ
have_passwordrMr"r"r#rJsz_NetlocResultMixinStr._userinfocCsl|j}|d\}}}|d\}}}|rL|d\}}}|d\}}}n|d\}}}|sdd}||fS)Nr\[]r]r^rAr__rbZhave_open_brZ	bracketedrSrXr"r"r#rPsz_NetlocResultMixinStr._hostinfoNrBrCrDrErZrJrPr"r"r"r#r[s

r[c@s(eZdZdZeddZeddZdS)_NetlocResultMixinBytesr"cCsD|j}|d\}}}|r4|d\}}}|s<d}nd}}||fS)N@:r^rar"r"r#rJsz!_NetlocResultMixinBytes._userinfocCsl|j}|d\}}}|d\}}}|rL|d\}}}|d\}}}n|d\}}}|sdd}||fS)Nri[]rjr^rer"r"r#rPsz!_NetlocResultMixinBytes._hostinfoNrgr"r"r"r#rhs

rh)
namedtuplezurl fragmentz!scheme netloc path query fragmentz(scheme netloc path params query fragmentz
DefragResult(url, fragment)

A 2-tuple that contains the url without fragment identifier and the fragment
identifier as a separate argument.
z$The URL with no fragment identifier.z
Fragment identifier separated from URL, that allows indirect identification of a
secondary resource by reference to a primary resource and additional identifying
information.
z
SplitResult(scheme, netloc, path, query, fragment)

A 5-tuple that contains the different components of a URL. Similar to
ParseResult, but does not split params.
z%Specifies URL scheme for the request.z0
Network location where the request is made to.
z@
The hierarchical path, such as the path to a file to download.
z
The query component, that contains non-hierarchical data, that along with data
in path component, identifies a resource in the scope of URI's scheme and
network location.
z
Fragment identifier, that allows indirect identification of a secondary resource
by reference to a primary resource and additional identifying information.
zq
ParseResult(scheme, netloc, path, params, query, fragment)

A 6-tuple that contains components of a parsed URL.
z
Parameters for last path element used to dereference the URI in order to provide
access to perform some operation on the resource.
c@seZdZdZddZdS)rr"cCs |jr|jd|jS|jSdSN#fragmenturlrKr"r"r#geturl@szDefragResult.geturlNrBrCrDrErsr"r"r"r#r>sc@seZdZdZddZdS)rr"cCst|SrrrKr"r"r#rsHszSplitResult.geturlNrtr"r"r"r#rFsc@seZdZdZddZdS)rr"cCst|SrrrKr"r"r#rsMszParseResult.geturlNrtr"r"r"r#rKsc@seZdZdZddZdS)rr"cCs |jr|jd|jS|jSdS)N#rprKr"r"r#rsSszDefragResultBytes.geturlNrtr"r"r"r#rQsc@seZdZdZddZdS)rr"cCst|SrrurKr"r"r#rs[szSplitResultBytes.geturlNrtr"r"r"r#rYsc@seZdZdZddZdS)rr"cCst|SrrvrKr"r"r#rs`szParseResultBytes.geturlNrtr"r"r"r#r^scCs4ttfttfttff}|D]\}}||_||_qdSr)rrrrrrr?rG)Z
_result_pairsZ_decodedZ_encodedr"r"r#_fix_result_transcodingdsrxTc
Csft||\}}}t|||}|\}}}}}|tkrHd|krHt|\}}nd}t||||||}	||	S)N;r)r=ruses_params_splitparamsr)
rrschemeallow_fragments_coerce_resultZsplitresultr_queryrqparamsresultr"r"r#rqscCsRd|kr,|d|d}|dkr6|dfSn
|d}|d|||ddfS)N/ryrrr8)findrfind)rrir"r"r#r{s

r{cCsHt|}dD]"}|||}|dkrt||}q|||||dfS)Nz/?#r)lenrmin)rrstartdelimcZwdelimr"r"r#_splitnetlocsrcCs|r|rdSddl}|dd}|dd}|dd}|dd}|d|}||kr`dSdD] }||krdtd	|d
dqddS)Nrr\rr]ro?ZNFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)isasciiunicodedatareplace	normalizerW)r_rnZnetloc2rr"r"r#_checknetlocsrcCstD]}||d}q|S)Nr)_UNSAFE_URL_BYTES_TO_REMOVEr)rrbr"r"r#_remove_unsafe_bytes_from_urlsrc
Csht||\}}}t|}t|}t|}|||t|t|f}t|d}|rV||Stttkrhtd}}}|	d}	|	dkr|d|	dkrR||	dd}|dddkrt
|d\}}d|krd	|ksd	|krd|krtd
|rd|kr|dd\}}d|kr*|dd\}}t
|td||||}
|
t|<||
S|d|	D]}|tkr^qq^||	dd}|rtd
d|Dr|d|	|}}|dddkrt
|d\}}d|krd	|ksd	|krd|krtd
|r&d|kr&|dd\}}d|kr@|dd\}}t
|t|||||}
|
t|<||
S)Nrr]rrr8//rcrdzInvalid IPv6 URLrorcss|]}|dkVqdS)
0123456789Nr"r1rr"r"r#r4szurlsplit.<locals>.<genexpr>)r=rbooltypergetrMAX_CACHE_SIZEr$rrrWsplitrrscheme_charsanyrR)
rrr|r}r~keycachedr_rrqrvrrestr"r"r#rsj





cCs<t|\}}}}}}}|r&d||f}|t|||||fS)Nz%s;%s)r=r)
componentsr|r_rrrrrqr~r"r"r#rs
cCst|\}}}}}}|s4|r`|tkr`|dddkr`|rP|dddkrPd|}d|pXd|}|rp|d|}|r|d|}|r|d|}||S)	Nrrr8rrr]rro)r=uses_netloc)rr|r_rrrrqr~r"r"r#rs c	Cs|s|S|s|St||\}}}t|d|\}}}}}}	t|||\}
}}}
}}|
|ks`|
tkrh||S|
tkr|r|t|
|||
||fS|}|s|
s|}|}
|s|}|t|
|||
||fS|d}|ddkr|d=|dddkr|d}n(||d}td|dd|dd<g}|D]P}|dkr\z|Wntk
rXYnXn|dkrlq(n
|	|q(|ddkr|	d|t|
|d
|pd|
||fS)Nrrr8...)rr)r=r
uses_relativerrrfilterpop
IndexErrorappendjoin)baserrr}r~ZbschemeZbnetlocZbpathZbparamsZbqueryZ	bfragmentr|r_pathrrrqZ
base_partsZsegmentsZ
resolved_pathZsegr"r"r#rsp







c	CsTt|\}}d|kr>t|\}}}}}}t|||||df}nd}|}|t||S)Nror)r=rrr)	rrr~srpaqZfragZdefragr"r"r#rGsZ0123456789ABCDEFabcdefc	Cs|s|jdSt|tr"|d}|d}t|dkr<|S|dg}|j}tdkrbddtDa|ddD]R}z(|t|dd||ddWqntk
r|d||YqnXqnd	|S)	Nutf-8rOr8rcSs.i|]&}tD]}||t||qqSr")_hexdigr*bytesfromhex)r1rrr"r"r#
<dictcomp>ms

z$unquote_to_bytes.<locals>.<dictcomp>r)
rr9r:r*rr
_hextobyterKeyErrorr)stringbitsresritemr"r"r#rZs,



z([-]+)rrcCst|trtdd|kr$|j|S|dkr0d}|dkr<d}t|}|dg}|j}tdt|dD],}|t||	|||||dqfd
|S)	NzExpected str, got bytesrNrrrr8rr)r9rr;r_asciirerrangerrr/r)rr+r,rrrrr"r"r#rzs 



F&c	CsNi}t|||||||d}|D]*\}	}
|	|kr>||	|
q|
g||	<q|S)N)r+r,max_num_fieldsrT)r
r)qskeep_blank_valuesstrict_parsingr+r,rrTZ
parsed_resultpairsnamevaluer"r"r#r	scCs.t|\}}t|\}}|r*t|ttfs2td|dk	rXd||}	||	krXtddd||D}
g}|
D]}|s|sqt|dd}
t|
dkr|rtd|f|rt|
d	nqtt|
ds|rt|
d
	dd}t
|||d
}||}|
d	dd}t
|||d
}||}|||fqt|S)Nz*Separator must be of type string or bytes.r8zMax number of fields exceededcSsg|]}|qSr"r")r1s1r"r"r#
<listcomp>szparse_qsl.<locals>.<listcomp>=rzbad query field: %rrr+ r3)r=r9r:rrWcountrrrrr)rrrr+r,rrTr~rf
num_fieldsrrZ
name_valueZnvrrr"r"r#r
s:cCs|dd}t|||S)Nrr)rr)rr+r,r"r"r#rssBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s$eZdZddZddZddZdS)QuotercCst||_dSr)_ALWAYS_SAFEunionsafe)rArr"r"r#__init__szQuoter.__init__cCsd|jjt|fS)Nz<%s %r>)	__class__rBdictrKr"r"r#__repr__szQuoter.__repr__cCs(||jkrt|nd|}|||<|S)Nz%{:02X})rchrformat)rArrr"r"r#__missing__#szQuoter.__missing__N)rBrCrDrrrr"r"r"r#rsrrcCsbt|tr8|s|S|dkrd}|dkr*d}|||}n |dk	rHtd|dk	rXtdt||S)Nrr&z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r9r:r*r;r
)rrr+r,r"r"r#r)s'
cCsdt|trd|ks$t|tr2d|kr2t||||St|trBd}nd}t|||||}|ddS)Nr r)r9r:rrr)rrr+r,Zspacer"r"r#r_s
cst|ttfstd|sdSt|tr6|dd}ntdd|D}|t|s^|Szt	|Wn&t
k
rt|jt	|<YnXd
fdd|DS)Nz!quote_from_bytes() expected bytesrr%ignorecSsg|]}|dkr|qS)r"rr"r"r#r}sz$quote_from_bytes.<locals>.<listcomp>csg|]}|qSr"r")r1charZquoterr"r#rs)r9r	bytearrayr;r:r*rstrip_ALWAYS_SAFE_BYTESr/r!rr__getitem__r)Zbsrr"rr#r
ps
c	Cst|dr|}nPzt|r0t|dts0tWn0tk
rbt\}}}td|YnXg}	|s|D]j\}
}t|
t	r||
|}
n|t
|
|||}
t|t	r|||}n|t
||||}|	|
d|qpn"|D]\}
}t|
t	r||
|}
n|t
|
|||}
t|t	rB|||}|	|
d|qt|t
rp|||||}|	|
d|qzt|}Wn:tk
r|t
||||}|	|
d|YqX|D]B}
t|
t	r||
|}
n|t
|
|||}
|	|
d|
qqd|	S)Nitemsrz1not a valid non-string sequence or mapping objectrr)
hasattrrrr9r5r;sysexc_infowith_tracebackrr:rr)rZdoseqrr+r,Z	quote_viaZtyZvatblkrr2Zeltr"r"r#rsR





cCstjdtddt|S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r
stacklevel)warningswarnDeprecationWarning	_to_bytesrrr"r"r#to_bytess
rcCsJt|trFz|d}Wn(tk
rDtdt|dYnX|S)NASCIIzURL z contains non-ASCII characters)r9r:r*r/UnicodeErrorreprrr"r"r#rs
rcCs`t|}|dddkr<|dddkr<|dd}|dddkr\|dd}|S)Nr8<r>zURL:)r:striprr"r"r#unwraps rcCstjdtddt|S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr
_splittyperr"r"r#	splittypes
rcCsDtdkrtdtjat|}|r<|\}}||fSd|fS)Nz
([^/:]+):(.*))	_typeprogrecompileDOTALLmatchgroupsrR)rrrr|datar"r"r#rs
rcCstjdtddt|S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr
_splithostrr"r"r#	splithost
s
r
cCsXtdkrtdtjat|}|rP|\}}|rH|ddkrHd|}||fSd|fS)Nz//([^/#?]*)(.*)rr)	_hostprogrrrrr)rrrZ	host_portrr"r"r#r	s
r	cCstjdtddt|S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr
_splituserhostr"r"r#	splituser$s
rcCs |d\}}}|r|nd|fS)Nr\r`)ruserrr"r"r#r+srcCstjdtddt|S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr_splitpasswd)rr"r"r#splitpasswd1s
rcCs |d\}}}||r|ndfSNr]rQ)rrZpasswdr"r"r#r8srcCstjdtddt|S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr
_splitportr
r"r"r#	splitport>s
rcCsDtdkrtdtjat|}|r<|\}}|r<||fS|dfS)Nz
(.*):([0-9]*))	_portprogrrr	fullmatchr)rrrXr"r"r#rGs
rrcCstjdtddt||S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr_splitnport)rdefportr"r"r#
splitnportUs
rcCsT|d\}}}|s|}n2|rLzt|}Wntk
rBd}YnX||fS||fSr)r`rVrW)rrrrXZnportr"r"r#r\s
rcCstjdtddt|S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr_splitqueryrr"r"r#
splitqueryms
rcCs$|d\}}}|r||fS|dfS)Nrr)rrrrrr"r"r#rtsrcCstjdtddt|S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr	_splittagrr"r"r#splittag|s
r cCs$|d\}}}|r||fS|dfSrnr)rrrrtagr"r"r#rsrcCstjdtddt|S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadrr)rrr
_splitattrrr"r"r#	splitattrs
r#cCs|d}|d|ddfS)Nryrr8)r)rrZwordsr"r"r#r"s
r"cCstjdtddt|S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadrr)rrr_splitvalue)attrr"r"r#
splitvalues
r&cCs |d\}}}||r|ndfS)Nrr)r%rrr"r"r#r$sr$)rT)r)rT)T)rr)FFrrNr)FFrrNr)rr)rNN)rNN)r)r)r)hrrcollectionsr__all__rrrzZnon_hierarchicalZ
uses_queryZ
uses_fragmentrrrrr$Z_implicit_encodingZ_implicit_errorsr(r-r7r=objectr>rFrHr[rhrmZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBase__doc__rrrqr|r_rrrZ
ResultBaserrrrrrrxrr{rrrrrrrrrrrrrrr	r
r	frozensetrrrr!defaultdictrrrr
rrrrrrrr
rr	rrrrrrrrrrrr rr#r"r&r$r"r"r"r#<module>s


%


	

;
E


*
C
	
6


Q




Back to Directory File Manager