Viewing File: /usr/lib64/python3.6/urllib/__pycache__/parse.cpython-36.opt-2.pyc

3

sja@s`ddlZddlZddlZdddddddd	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Zddd0ddd5dddd d+dd"g
Z	d6Z
d7Zd8d9d:gZd;Z
iZd<d=Zd>Zd?Zd@dAZeefdBdCZeefdDdEZdFdGZGdHdIdIeZGdJdKdKeZGdLdMdMeZGdNdOdOeeZGdPdQdQeeZddRlmZeddSZeddTZeddUZdVe_ dWej!_ dXej"_ dYe_ dZej#_ d[ej$_ 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(GdaddeeZ)GdbddeeZ*GdcddeeZ+GddddeeZ,GdeddeeZ-GdfddeeZ.dgdhZ/e/[/ddjdZ0dkdlZ1ddmdnZ2dodpZ3dqdrZ4ddsdZ5dtdZ6dudZ7ddvdZ8dwdZ9dxZ:da;dydZ<ej=dzZ>dd}dZ?ddd	Z@ddd
ZAdddZBeCdZDeEeDZFiZGGdddejHZIdddZJdddZKddd
ZLd~dddeKfddZMddZNddZOdaPddZQdaRddZSddZTddZUdaVddZWdddZXddZYddZZddZ[ddZ\dS)Nurlparse
urlunparseurljoin	urldefragurlsplit
urlunsplit	urlencodeparse_qs	parse_qslquote
quote_plusquote_from_bytesunquoteunquote_plusunquote_to_bytesDefragResultParseResultSplitResultDefragResultBytesParseResultBytesSplitResultBytesZftphttpZgopherZnntpZimapZwaisfileZhttpsZshttpZmmsZprosperoZrtspZrtspuZsftpZsvnzsvn+sshZwsZwssZtelnetZsnewsZrsyncZnfsZgitzgit+sshZhdlZsipZsipsZtelZmailtoZnewszAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!	

 	

cCstjtjdS)N)_parse_cacheclear
_safe_quotersr!r!$/usr/lib64/python3.6/urllib/parse.pyclear_cache^sr#asciistrictcCs|S)Nr!)objr!r!r"_noopmsr'cCs|j||S)N)encode)r&encodingerrorsr!r!r"_encode_resultpsr+cstfdd|DS)Nc3s"|]}|r|jndVqdS)rN)decode).0x)r)r*r!r"	<genexpr>vsz_decode_args.<locals>.<genexpr>)tuple)argsr)r*r!)r)r*r"_decode_argstsr2cGsZt|dt}x.|ddD]}|rt|t|krtdqW|rL|tfSt|tfS)Nrz$Cannot mix str and non-str arguments)
isinstancestr	TypeErrorr'r2r+)r1Z	str_inputargr!r!r"_coerce_argsxs
r8c@seZdZfZdddZdS)_ResultMixinStrr$r%cs|jfdd|DS)Nc3s|]}|jVqdS)N)r()r-r.)r)r*r!r"r/sz)_ResultMixinStr.encode.<locals>.<genexpr>)_encoded_counterpart)selfr)r*r!)r)r*r"r(sz_ResultMixinStr.encodeN)r$r%)__name__
__module____qualname__	__slots__r(r!r!r!r"r9sr9c@seZdZfZdddZdS)_ResultMixinBytesr$r%cs|jfdd|DS)Nc3s|]}|jVqdS)N)r,)r-r.)r)r*r!r"r/sz+_ResultMixinBytes.decode.<locals>.<genexpr>)_decoded_counterpart)r;r)r*r!)r)r*r"r,sz_ResultMixinBytes.decodeN)r$r%)r<r=r>r?r,r!r!r!r"r@sr@c@s@eZdZfZeddZeddZeddZeddZd	S)
_NetlocResultMixinBasecCs
|jdS)Nr)	_userinfo)r;r!r!r"usernamesz_NetlocResultMixinBase.usernamecCs
|jdS)Nr3)rC)r;r!r!r"passwordsz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|tr dnd}|j|\}}}|j||S)Nr%%)	_hostinfor4r5	partitionlower)r;hostname	separatorZpercentZzoner!r!r"rKs
z_NetlocResultMixinBase.hostnamecCs@|jd}|dk	r<t|d}d|ko.dkns<td|S)Nr3
rizPort out of range 0-65535)rHint
ValueError)r;portr!r!r"rPs

z_NetlocResultMixinBase.portN)	r<r=r>r?propertyrDrErKrPr!r!r!r"rBs
rBc@s(eZdZfZeddZeddZdS)_NetlocResultMixinStrcCsD|j}|jd\}}}|r4|jd\}}}|s<d}nd}}||fS)N@:)netloc
rpartitionrI)r;rUuserinfo	have_infohostinforD
have_passwordrEr!r!r"rCsz_NetlocResultMixinStr._userinfocCsl|j}|jd\}}}|jd\}}}|rL|jd\}}}|jd\}}}n|jd\}}}|sdd}||fS)NrS[]rT)rUrVrI)r;rU_rYhave_open_br	bracketedrKrPr!r!r"rHsz_NetlocResultMixinStr._hostinfoN)r<r=r>r?rQrCrHr!r!r!r"rRsrRc@s(eZdZfZeddZeddZdS)_NetlocResultMixinBytescCsD|j}|jd\}}}|r4|jd\}}}|s<d}nd}}||fS)N@:)rUrVrI)r;rUrWrXrYrDrZrEr!r!r"rCsz!_NetlocResultMixinBytes._userinfocCsl|j}|jd\}}}|jd\}}}|rL|jd\}}}|jd\}}}n|jd\}}}|sdd}||fS)Nra[]rb)rUrVrI)r;rUr]rYr^r_rKrPr!r!r"rHsz!_NetlocResultMixinBytes._hostinfoN)r<r=r>r?rQrCrHr!r!r!r"r`sr`)
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.
zr
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@seZdZfZddZdS)rcCs |jr|jd|jS|jSdS)N#)fragmenturl)r;r!r!r"geturlCszDefragResult.geturlN)r<r=r>r?rir!r!r!r"rAsc@seZdZfZddZdS)rcCst|S)N)r)r;r!r!r"riKszSplitResult.geturlN)r<r=r>r?rir!r!r!r"rIsc@seZdZfZddZdS)rcCst|S)N)r)r;r!r!r"riPszParseResult.geturlN)r<r=r>r?rir!r!r!r"rNsc@seZdZfZddZdS)rcCs |jr|jd|jS|jSdS)N#)rgrh)r;r!r!r"riVszDefragResultBytes.geturlN)r<r=r>r?rir!r!r!r"rTsc@seZdZfZddZdS)rcCst|S)N)r)r;r!r!r"ri^szSplitResultBytes.geturlN)r<r=r>r?rir!r!r!r"r\sc@seZdZfZddZdS)rcCst|S)N)r)r;r!r!r"ricszParseResultBytes.geturlN)r<r=r>r?rir!r!r!r"rascCs8ttfttfttff}x|D]\}}||_||_qWdS)N)rrrrrrr:rA)Z
_result_pairsZ_decodedZ_encodedr!r!r"_fix_result_transcodinggs
rkTc
Csft||\}}}t|||}|\}}}}}|tkrHd|krHt|\}}nd}t||||||}	||	S)N;r)r8ruses_params_splitparamsr)
rhschemeallow_fragments_coerce_resultZsplitresultrUqueryrgparamsresultr!r!r"rtscCsRd|kr,|jd|jd}|dkr6|dfSn
|jd}|d|||ddfS)N/rlrrr3)findrfind)rhir!r!r"rns

rncCsLt|}x*dD]"}|j||}|dkrt||}qW|||||dfS)Nz/?#r)lenrvmin)rhstartdelimcZwdelimr!r!r"_splitnetlocs
r~cCs|stdd|DrdSddl}|jdd}|jdd}|jdd}|jdd}|jd	|}||krndSx(d
D] }||krttd|dd
qtWdS)Ncss|]}t|dkVqdS)N)ord)r-r}r!r!r"r/sz_checknetloc.<locals>.<genexpr>rrSrrTrf?ZNFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)anyunicodedatareplaceZ	normalizerO)rUrnZnetloc2r}r!r!r"_checknetlocs
rcCsxtD]}|j|d}qW|S)Nr)_UNSAFE_URL_BYTES_TO_REMOVEr)rhbr!r!r"_remove_unsafe_bytes_from_urls
rc
Cst||\}}}t|}t|}|jt}|jt}t|}|||t|t|f}tj|d}|rj||St	tt
kr|td}}}|jd}	|	dkr|d|	dkr~|d|	j
}||	dd}|dddkrt|d\}}d|kod	|ksd	|krd|krtd
|r<d|kr<|jdd\}}d|krV|jdd\}}t|t|||||}
|
t|<||
Sxd|d|	D]}|tkrPqW||	dd}|std
d|Dr|d|	j
|}}|dddkr4t|d\}}d|krd	|ks,d	|kr4d|kr4td
|rTd|krT|jdd\}}d|krn|jdd\}}t|t|||||}
|
t|<||
S)NrrTrrr3z//r[r\zInvalid IPv6 URLrfrcss|]}|dkVqdS)
0123456789Nr!)r-r}r!r!r"r/szurlsplit.<locals>.<genexpr>)r8rlstrip_WHATWG_C0_CONTROL_OR_SPACEstripbooltypergetryMAX_CACHE_SIZEr#rvrJr~rOsplitrrscheme_charsr)
rhrorprqkeycachedrUrrrgrxvr}restr!r!r"rsd






cCs<t|\}}}}}}}|r&d||f}|t|||||fS)Nz%s;%s)r8r)
componentsrorUrhrsrrrgrqr!r!r"rscCst|\}}}}}}|s4|r`|tkr`|dddkr`|rP|dddkrPd|}d|pXd|}|rp|d|}|r|d|}|r|d|}||S)	Nrz//r3rurrTrrf)r8uses_netloc)rrorUrhrrrgrqr!r!r"rs cCs|s|S|s|St||\}}}t|d|\}}}}}}	t|||\}
}}}
}}|
|ks`|
tkrh||S|
tkr|r|t|
|||
||fS|}|r|
r|}|}
|s|}|t|
|||
||fS|jd}|ddkr|d=|dddkr|jd}n(||jd}td|dd|dd	<g}xX|D]P}|dkrdy|jWntk
r`YnXn|dkrtq0n
|j	|q0W|d
dkr|j	d|t|
|dj
|pd|
||fS)Nrrur3...rrrr)rr)r8r
uses_relativerrrfilterpop
IndexErrorappendjoin)baserhrprqZbschemeZbnetlocZbpathZbparamsZbqueryZ	bfragmentrorUpathrsrrrgZ
base_partsZsegmentsZ
resolved_pathZsegr!r!r"r
sT






c	CsTt|\}}d|kr>t|\}}}}}}t|||||df}nd}|}|t||S)Nrfr)r8rrr)	rhrqsrpaqZfragZdefragr!r!r"rOsZ0123456789ABCDEFabcdefcCs|s|jdSt|tr"|jd}|jd}t|dkr<|S|dg}|j}tdkrbddtDaxb|ddD]R}y(|t|dd||ddWqptk
r|d||YqpXqpWdj	|S)	Nzutf-8rGr3rcSs4i|],}tD]"}tt||dg||jqqS))_hexdigbytesrNr()r-rrr!r!r"
<dictcomp>usz$unquote_to_bytes.<locals>.<dictcomp>r)
rr4r5r(ryr
_hextobyterKeyErrorr)stringbitsresritemr!r!r"rbs*



z([-]+)utf-8rcCsd|kr|j|S|dkrd}|dkr*d}tj|}|dg}|j}x@tdt|dD],}|t||j|||||dqVWdj|S)NrFzutf-8rrr3rr)r_asciirerrangeryrr,r)rr)r*rrrrxr!r!r"rs


F&c	CsRi}t|||||||d}x2|D]*\}	}
|	|kr@||	j|
q |
g||	<q W|S)N)r)r*max_num_fieldsrL)r
r)qskeep_blank_valuesstrict_parsingr)r*rrLZ
parsed_resultpairsnamevaluer!r!r"r	s
cCs.t|\}}|s"t|ttfr*td|dk	rPd|j|}||krPtddd|j|D}	g}
x|	D]}|r|rqn|jdd}t|dkr|rtd|f|rn|jd	nqnt|ds|rn|d
j	dd}
t
|
||d
}
||
}
|dj	dd}t
|||d
}||}|
j|
|fqnW|
S)Nz*Separator must be of type string or bytes.r3zMax number of fields exceededcSsg|]}|qSr!r!)r-s1r!r!r"
<listcomp>szparse_qsl.<locals>.<listcomp>=rzbad query field: %rrr+ )r)r*)r8r4r5rrOcountrryrrr)rrrr)r*rrLrq
num_fieldsrrZ
name_valueZnvrrr!r!r"r
s8
cCs|jdd}t|||S)Nrr)rr)rr)r*r!r!r"rssAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-c@s$eZdZddZddZddZdS)QuotercCstj||_dS)N)_ALWAYS_SAFEunionsafe)r;rr!r!r"__init__ szQuoter.__init__cCsd|jjt|fS)Nz<%s %r>)	__class__r<dict)r;r!r!r"__repr__$szQuoter.__repr__cCs(||jkrt|ndj|}|||<|S)Nz%{:02X})rchrformat)r;rrr!r!r"__missing__(szQuoter.__missing__N)r<r=r>rrrr!r!r!r"rsrrucCsbt|tr8|s|S|dkrd}|dkr*d}|j||}n |dk	rHtd|dk	rXtdt||S)Nzutf-8r%z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r4r5r(r6r
)rrr)r*r!r!r"r.s
cCsdt|trd|ks$t|tr2d|kr2t||||St|trBd}nd}t|||||}|jddS)Nr r)r4r5rrr)rrr)r*Zspacer!r!r"rZs
cst|ttfstd|sdSt|tr6|jdd}ntdd|D}|jt|s^|jSyt	|Wn&t
k
rt|jt	|<YnXdj
fdd|DS)Nz!quote_from_bytes() expected bytesrr$ignorecSsg|]}|dkr|qS)r!)r-r}r!r!r"rxsz$quote_from_bytes.<locals>.<listcomp>csg|]}|qSr!r!)r-char)quoterr!r"rs)r4r	bytearrayr6r5r(rstrip_ALWAYS_SAFE_BYTESr,r rr__getitem__r)Zbsrr!)rr"r
ks
cCst|dr|j}nRy t|r2t|dtr2tWn0tk
rdtj\}}}tdj|YnXg}	|sxr|D]j\}
}t|
t	r||
|}
n|t
|
|||}
t|t	r|||}n|t
||||}|	j|
d|qtWn,x(|D]\}
}t|
t	r||
|}
n|t
|
|||}
t|t	rL|||}|	j|
d|qt|t
rz|||||}|	j|
d|qyt|}Wn:tk
r|t
||||}|	j|
d|YqXxJ|D]B}
t|
t	r||
|}
n|t
|
|||}
|	j|
d|
qWqWdj|	S)Nitemsrz1not a valid non-string sequence or mapping objectrr)
hasattrrryr4r0r6sysexc_infowith_tracebackrr5rr)rrZdoseqrr)r*Z	quote_viaZtyZvatblkrr.Zeltr!r!r"rsP





cCsJt|trFy|jdj}Wn(tk
rDtdt|dYnX|S)NASCIIzURL z contains non-ASCII characters)r4r5r(r,UnicodeErrorrepr)rhr!r!r"to_bytess
rcCs`t|j}|dddkr<|dddkr<|ddj}|dddkr\|ddj}|S)Nr3<>zURL:rr)r5r)rhr!r!r"unwraps rcCsDtdkrtjdtjatj|}|r<|j\}}|j|fSd|fS)Nz
([^/:]+):(.*))	_typeprogrecompileDOTALLmatchgroupsrJ)rhrrodatar!r!r"	splittypes
rcCsXtdkrtjdtjatj|}|rP|j\}}|rH|ddkrHd|}||fSd|fS)Nz//([^/#?]*)(.*)rru)	_hostprogrrrrr)rhrZ	host_portrr!r!r"	splithosts
rcCs |jd\}}}|r|nd|fS)NrS)rV)hostuserr|r!r!r"	splitusersrcCs |jd\}}}||r|ndfS)NrT)rI)rr|Zpasswdr!r!r"splitpasswdsrcCsDtdkrtjdtjatj|}|r<|j\}}|r<||fS|dfS)Nz(.*):([0-9]*)$)	_portprogrrrrr)rrrPr!r!r"	splitports
rr3cCsT|jd\}}}|s|}n2|rLyt|}Wntk
rBd}YnX||fS||fS)NrT)rVrNrO)rZdefportr|rPZnportr!r!r"
splitnports
rcCs$|jd\}}}|r||fS|dfS)Nr)rV)rhrr|rrr!r!r"
splitquery+srcCs$|jd\}}}|r||fS|dfS)Nrf)rV)rhrr|tagr!r!r"splittag2srcCs|jd}|d|ddfS)Nrlrr3)r)rhZwordsr!r!r"	splitattr9s
rcCs |jd\}}}||r|ndfS)Nr)rI)attrr|rr!r!r"
splitvalue?sr)rT)r)rT)T)rr)FFrrNr)FFrrNr)rr)ruNN)rNN)rur)r)]rrcollections__all__rrrmZnon_hierarchicalZ
uses_queryZ
uses_fragmentrrrrrr#Z_implicit_encodingZ_implicit_errorsr'r+r2r8objectr9r@rBrRr`reZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBase__doc__rhrgrorUrrrrsZ
ResultBaserrrrrrrkrrnr~rrrrrrrrrrrrrr	r
r	frozensetrrrr defaultdictrrrr
rrrrrrrrrrrrrrrrr!r!r!r"<module>"s





!


	

@
E


)
A
	
,

O


Back to Directory File Manager