Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / rfc3986 / parseresult.pyc
Size: Mime:
ó
ȍEYc@sâdZddlmZddlmZddlmZddlmZddlmZddlmZdZ	dZ
defd„ƒYZd	ed	e
ƒefd„ƒYZ
d
ed
e
ƒefd„ƒYZd„Zd„ZdS(s3Module containing the urlparse compatibility logic.iÿÿÿÿ(t
namedtuplei(tcompat(t
exceptions(tmisc(tnormalizers(turitParseResulttParseResultBytestschemetuserinfothosttporttpathtquerytfragmenttParseResultMixincBsGeZd„Zd„Zed„ƒZed„ƒZed„ƒZRS(csŸ‡fd†dDƒ\}}}|j|ksL|j|ksL|j|kr˜|rddj|ƒ}ntjtj||jƒtj||jƒ|fƒS|j	S(Nc3s|]}ˆ|VqdS(N((t.0tp(t
attributes(sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pys	<genexpr>"sR	R
Rs{0}(suserinfoshostsport(
R	R
RtformatRtnormalize_authorityRtto_strtencodingt	authority(tselfRR	R
R((RsH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyt_generate_authoritys
cCs
|jƒS(s*Shim to match the standard library method.(tunsplit(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pytgeturl0scCs|jS(s#Shim to match the standard library.(R
(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pythostname4scCs|jS(s#Shim to match the standard library.(R(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pytnetloc9scCs|jS(s#Shim to match the standard library.(R
(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pytparams>s(t__name__t
__module__RRtpropertyRRR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyRs
		c
Bs¹eZdZd	Zdd„Zed
d
d
d
d
d
d
dd„ƒZedeed„ƒZ	e
d„ƒZej
ej
ej
ej
ej
ej
ej
d„Zd
d„Zed„ZRS(s›Implementation of urlparse compatibility class.

    This uses the URIReference logic to handle compatibility with the
    urlparse.ParseResult class.
    sutf-8c

Cs[tt|ƒj||pd|p$d||p0d|p9d||ƒ}
|	|
_||
_|
S(sCreate a new ParseResult.N(tsuperRt__new__tNoneRt	reference(tclsRR	R
RRR
Rturi_refRtparse_result((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR#Ns							c	Csød}	|dk	r#|	|d7}	n|dk	r<|	|7}	n|dk	r^|	dj|ƒ7}	ntjd|d|	d|d|d|d	|ƒjƒ}
t|
d
tƒ\}}}|d|
jd|d|d
|d|
jd|
j	d|
j
d|
d	|ƒ	S(s-Create a ParseResult instance from its parts.tt@s:{0}RRRR
RRtstrictR	R
RR'N(R$RRtURIReferencet	normalizetauthority_fromtTrueRRR
R(R&RR	R
RRR
RRRR'((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyt
from_parts^s.
			c	Cs‹tjj||ƒ}|s*|jƒ}nt||ƒ\}}}|d|jd|d|d|d|jd|jd|jd|d	|ƒ	S(
sªParse a URI from the given unicode URI string.

        :param str uri_string: Unicode URI to be parsed into a reference.
        :param str encoding: The encoding of the string provided
        :param bool strict: Parse strictly according to :rfc:`3986` if True.
            If False, parse similarly to the standard library's urlparse
            function.
        :returns: :class:`ParseResult` or subclass thereof
        RR	R
RRR
RR'R(	RR,tfrom_stringR-R.RRR
R(	R&t
uri_stringRR+tlazy_normalizeR%R	R
R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR1zs			cCs
|jjS(s Return the normalized authority.(R%R(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR•scCsÑtt|||||||fƒ}i}	x?|D]7\}
}|tjkr^t||
ƒ}n||	|
<q1W|j|	ƒ}|jjd|	dd|d|	dd|	dd|	dƒ}
td|
d|j	|	S(s>Create a copy of this instance replacing with specified parts.RRRR
RR'R(
tziptPARSED_COMPONENTSRtUseExistingtgetattrRR%t	copy_withRR(RRR	R
RRR
RRt
attrs_dicttnametvalueRtref((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR8šs


csMˆp|j‰ttt‡fd†|Dƒƒƒ}td|jdˆ|S(s+Convert to an instance of ParseResultBytes.c3s3|])}t|dƒr'|jˆƒn|VqdS(tencodeN(thasattrR=(Rtattr(R(sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pys	<genexpr>³sR'R(RtdictR4R5RR%(RRtattrs((RsH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR=®s	cCs[|}|rN|jrN|jjdƒ}|j|jƒ}|jd|ƒ}n|jjƒS(s‚Create a URI string from the components.

        :returns: The parsed URI reconstituted as a string.
        :rtype: str
        tidnaR
(R
R=tdecodeRR8R%R(Rtuse_idnaR(t	hostbytesR
((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR»s(N(RR t__doc__tslotsR#tclassmethodR$R0R/R1R!RRR6R8R=tFalseR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyRDs 
cBs°eZdZded„Zedddddddded„	ƒZedeed„ƒZe	d„ƒZ
ejejejejejejejed„Z
ed„ZRS(	s<Compatibility shim for the urlparse.ParseResultBytes object.sutf-8cCsptt|ƒj||pd|p$d||p0d|p9d|pBd|pKdƒ}|	|_||_|
|_|S(s'Create a new ParseResultBytes instance.N(R"RR#R$RR%R3(R&RR	R
RRR
RR'RR3R(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR#Ís								c

CsFd}
|dk	r#|
|d7}
n|dk	r<|
|7}
n|dk	rd|
djt|ƒƒ7}
ntjd|d|
d|d|d|d	|ƒ}|	s©|jƒ}ntj}t|d
t	ƒ\}}}|d|||ƒd|||ƒd|||ƒd
|d|||ƒd|||ƒd|||ƒd|d	|d|	ƒ
S(s-Create a ParseResult instance from its parts.R)R*s:{0}RRRR
RRR+R	R
RR'R3N(
R$RtintRR,R-Rtto_bytesR.R/(
R&RR	R
RRR
RRR3RR'RK((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR0Þs6
		c
CsÐtjj||ƒ}|s*|jƒ}nt||ƒ\}}}tj}	|d|	|j|ƒd|	||ƒd|	||ƒd|d|	|j|ƒd|	|j	|ƒd|	|j
|ƒd|d	|d
|ƒ
S(s¯Parse a URI from the given unicode URI string.

        :param str uri_string: Unicode URI to be parsed into a reference.
        :param str encoding: The encoding of the string provided
        :param bool strict: Parse strictly according to :rfc:`3986` if True.
            If False, parse similarly to the standard library's urlparse
            function.
        :returns: :class:`ParseResultBytes` or subclass thereof
        RR	R
RRR
RR'RR3(RR,R1R-R.RRKRRR
R(
R&R2RR+R3R%R	R
RRK((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR1ÿs	cCs|jjj|jƒS(s Return the normalized authority.(R%RR=R(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyRsc	
Csett|||||||fƒ}	i}
xs|	D]k\}}|tjkr^t||ƒ}nt|tƒr’t|dƒr’|j|j	ƒ}n||
|<q1W|j
|
ƒ}
tj}|j
jd||
d|j	ƒd||
|j	ƒd||
d|j	ƒd||
d|j	ƒd||
d|j	ƒƒ}|sF|jƒ}ntd|d|j	d	||
S(
s>Create a copy of this instance replacing with specified parts.R=RRRR
RR'RR3(R4R5RR6R7t
isinstancetbytesR>R=RRRRR%R8R-R(RRR	R
RRR
RR3RR9R:R;RRR<((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR8!s0		cCs‹|}|rN|jrN|jj|jƒ}|jdƒ}|jd|ƒ}n|jrl|jdtƒ}n|jjƒ}|j|jƒS(sŠCreate a URI bytes object from the components.

        :returns: The parsed URI reconstituted as a string.
        :rtype: bytes
        RBR
R3(	R
RCRR=R8R3RIR%R(RRDR(R
RER((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyRAs	N(RR RFR/R#RHR$R0R1R!RRR6R8RIR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyRÉscCsÕd}}}d}|}d|krA|jddƒ\}}n|jdƒru|jddƒ\}}|d7}nd|krœ|jddƒ\}}n|r²|r²|}n|rÈ|rÈ|}n|||fS(NR*it[t]t:(R$trsplitt
startswithtsplit(RR	R
Rt
extra_hosttrest((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pytsplit_authorityTs

	
	cs³y|jƒ‰Wn8tjk
rJ|r/‚nt|jƒ\}}}n X‡fd†dDƒ\}}}|r¦yt|ƒ}Wq¦tk
r¢tj|ƒ‚q¦Xn|||fS(Nc3s|]}ˆj|ƒVqdS(N(tget(RR(tsubauthority(sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pys	<genexpr>ysR	R
R(suserinfoshostsport(tauthority_infoRtInvalidAuthorityRVRRJt
ValueErrortInvalidPort(R%R+R	R
R((RXsH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyR.os
N(sParseResultsParseResultBytes(sschemesuserinfoshostsportspathsquerysfragment(RFtcollectionsRR)RRRRRt__all__R5tobjectRRRRVR.(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/rfc3986/parseresult.pyt<module>s &„Š