ACC SHELL

Path : /usr/lib/python/
File Upload :
Current File : //usr/lib/python/urlparse.pyo

Ñò
oÄMc@s®dZddddddddgZd	d
ddd
ddddddddddgZd	d
dddd
ddddddddddddddgZddddddd
dd d!g
Zd	ddd
d
ddddd d!dddgZd
dd
ddddddd d!dgZd	dd
ddddddddddg
Zd"Zd#Z	hZ
d$„Zd%efd&„ƒYZ
d'd(klZd)ed)d*ƒe
fd+„ƒYZd,ed,d-ƒe
fd.„ƒYZded/„Zd0„Zd1d2„Zded3„Zd4„Zd5„Zed6„Zd7„Zed8„ed9ƒDƒƒZeid:„ed9ƒDƒƒd;„Zd1d1d<„Z d1d1d=„Z!d>Z"d?„Z#e$d@joe#ƒndAS(BsParse (absolute and relative) URLs.

See RFC 1808: "Relative Uniform Resource Locators", by R. Fielding,
UC Irvine, June 1995.
turlparset
urlunparseturljoint	urldefragturlsplitt
urlunsplittparse_qst	parse_qsltftpthttptgophertnntptimaptwaistfilethttpstshttptmmstprosperotrtsptrtsputtsftpttelnettsnewstrsynctsvnssvn+sshthdltmailtotnewstsiptsipssAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.icCstiƒdS(sClear the parse cache.N(t_parse_cachetclear(((s/usr/lib/python2.6/urlparse.pytclear_cache&stResultMixincBsJeZdZed„ƒZed„ƒZed„ƒZed„ƒZRS(s-Shared methods for the parsed result objects.cCs\|i}d|joB|iddƒd}d|jo|iddƒd}n|SdS(Nt@iit:(tnetloctrsplittsplittNone(tselfR&tuserinfo((s/usr/lib/python2.6/urlparse.pytusername.s	

cCsV|i}d|jo<|iddƒd}d|jo|iddƒdSndS(NR$iiR%(R&R'R(R)(R*R&R+((s/usr/lib/python2.6/urlparse.pytpassword8s	

cCsh|i}d|jo|iddƒd}nd|jo|iddƒd}n|iƒpdS(NR$iR%i(R&R'R(tlowerR)(R*R&((s/usr/lib/python2.6/urlparse.pythostnameAs	

cCse|i}d|jo|iddƒd}nd|jo$|iddƒd}t|dƒSdS(NR$iR%i
(R&R'R(tintR)(R*R&tport((s/usr/lib/python2.6/urlparse.pyR1Js	

(t__name__t
__module__t__doc__tpropertyR,R-R/R1(((s/usr/lib/python2.6/urlparse.pyR#+s

		iÿÿÿÿ(t
namedtupletSplitResults!scheme netloc path query fragmentcBseZdZd„ZRS(cCs
t|ƒS(N(R(R*((s/usr/lib/python2.6/urlparse.pytgeturlZs((R2R3t	__slots__R8(((s/usr/lib/python2.6/urlparse.pyR7VstParseResults(scheme netloc path params query fragmentcBseZdZd„ZRS(cCs
t|ƒS(N(R(R*((s/usr/lib/python2.6/urlparse.pyR8bs((R2R3R9R8(((s/usr/lib/python2.6/urlparse.pyR:^scCsvt|||ƒ}|\}}}}}|tjo#d|jot|ƒ\}}nd}t||||||ƒS(s#Parse a URL into 6 components:
    <scheme>://<netloc>/<path>;<params>?<query>#<fragment>
    Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes.t;R(Rtuses_paramst_splitparamsR:(turltschemetallow_fragmentsttupleR&tquerytfragmenttparams((s/usr/lib/python2.6/urlparse.pyRfscCsid|jo7|id|idƒƒ}|djo|dfSn|idƒ}|| ||dfS(Nt/R;iRi(tfindtrfind(R>ti((s/usr/lib/python2.6/urlparse.pyR=ts

icCsdt|ƒ}x@dD]8}|i||ƒ}|djot||ƒ}qqW|||!||fS(Ns/?#i(tlenRFtmin(R>tstarttdelimtctwdelim((s/usr/lib/python2.6/urlparse.pyt_splitnetloc}s
cCsyt|ƒ}|||t|ƒt|ƒf}ti|d
ƒ}|o|Sttƒtjotƒnd}}}|idƒ}|djo#|| djoÈ|| i	ƒ}||d}|d djot
|dƒ\}}n|o)d|jo|iddƒ\}}nd	|jo|id	dƒ\}}nt|||||ƒ}	|	t|<|	SxG|| D]}
|
t
joPqwqwW|| i	ƒ||d}}n|d djot
|dƒ\}}n|o6|tjo)d|jo|iddƒ\}}n|tjo)d	|jo|id	dƒ\}}nt|||||ƒ}	|	t|<|	S(sParse a URL into 5 components:
    <scheme>://<netloc>/<path>?<query>#<fragment>
    Return a 5-tuple: (scheme, netloc, path, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes.RR%iR	iis//t#t?N(tboolttypeR tgetR)RItMAX_CACHE_SIZER"RFR.ROR(R7tscheme_charst
uses_fragmentt
uses_query(R>R?R@tkeytcachedR&RBRCRHtvRM((s/usr/lib/python2.6/urlparse.pyR…sH!



	#!
cCsL|\}}}}}}|od||f}nt|||||fƒS(súPut a parsed URL back together again.  This may result in a
    slightly different, but equivalent URL, if the URL that was parsed
    originally had redundant delimiters, e.g. a ? with an empty query
    (the draft states that these are equivalent).s%s;%s(R(tdataR?R&R>RDRBRC((s/usr/lib/python2.6/urlparse.pyR±scCsÏ|\}}}}}|p%|o]|tjoP|d djo?|o|d djod|}nd|pd|}n|o|d|}n|o|d|}n|o|d|}n|S(	Nis//iRERR%RQRP(tuses_netloc(R\R?R&R>RBRC((s/usr/lib/python2.6/urlparse.pyR»s,c
Cs¯|p|S|p|St|d|ƒ\}}}}}}t|||ƒ\}	}
}}}
}|	|jp
|	tjo|S|	tjo.|
ot|	|
|||
|fƒS|}
n|d djot|	|
|||
|fƒS|pk|}|p
|}n'|d }t|	|
|||
|fƒS|
p
|}
nt|	|
|||
|fƒS|idƒd |idƒ}|ddjod|d<nxd|jo|idƒqœWxvd}t|ƒd}xZ||joK||djo,||dd	jo||d|d5Pn|d}q×WPq¾|ddgjod|d<n6t|ƒdjo"|ddjodg|d)nt|	|
di|ƒ||
|fƒS(
saJoin a base URL and a possibly relative URL to form an absolute
    interpretation of the latter.RiREiÿÿÿÿt.s..iiþÿÿÿ(Rs..(Rt
uses_relativeR]RR(tremoveRItjoin(tbaseR>R@tbschemetbnetloctbpathtbparamstbqueryt	bfragmentR?R&tpathRDRBRCtsegmentsRHtn((s/usr/lib/python2.6/urlparse.pyRÈsd$$




 

$cCsbd|joGt|ƒ\}}}}}}t|||||dfƒ}||fS|dfSdS(s¿Removes any existing fragment from URL.

    Returns a tuple of the defragmented URL and the fragment.  If
    the URL contained no fragments, the second element is the
    empty string.
    RPRN(RR(R>tsRktptatqtfragtdefrag((s/usr/lib/python2.6/urlparse.pyRs

ccs)x"|]}d|t|ƒfVqWdS(s%02xN(tchr(t.0RH((s/usr/lib/python2.6/urlparse.pys	<genexpr>s	iccs)x"|]}d|t|ƒfVqWdS(s%02XN(Rr(RsRH((s/usr/lib/python2.6/urlparse.pys	<genexpr>s	c	Cs¿|idƒ}x tdt|ƒƒD]‰}||}yt|d |d||<Wq%tj
od|||<q%tj
o,tt|d dƒƒ|d||<q%Xq%Wdi|ƒS(s"unquote('abc%20def') -> 'abc def'.t%iiiR(	R(txrangeRIt	_hextochrtKeyErrortUnicodeDecodeErrortunichrR0Ra(RltresRHtitem((s/usr/lib/python2.6/urlparse.pytunquotes
.cCs\h}xOt|||ƒD];\}}||jo||i|ƒq|g||<qW|S(sªParse a query given as a string argument.

        Arguments:

        qs: URL-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            URL encoded queries should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.
    (Rtappend(tqstkeep_blank_valueststrict_parsingtdicttnametvalue((s/usr/lib/python2.6/urlparse.pyR#s
cCs8g}|idƒD]#}|idƒD]
}||q'q~}g}xë|D]ã}|o|oqMn|iddƒ}	t|	ƒdjo:|otd|f‚n|o|	idƒqÉqMnt|	dƒp|oOt|	did	d
ƒƒ}
t|	did	d
ƒƒ}|i|
|fƒqMqMW|S(sžParse a query given as a string argument.

    Arguments:

    qs: URL-encoded query string to be parsed

    keep_blank_values: flag indicating whether blank values in
        URL encoded queries should be treated as blank strings.  A
        true value indicates that blanks should be retained as blank
        strings.  The default false value indicates that blank values
        are to be ignored and treated as if they were  not included.

    strict_parsing: flag indicating what to do with parsing errors. If
        false (the default), errors are silently ignored. If true,
        errors raise a ValueError exception.

    Returns a list, as G-d intended.
    t&R;t=iisbad query field: %rRit+t (R(RIt
ValueErrorR}R|treplace(R~RR€t_[1]ts1ts2tpairstrt
name_valuetnvR‚Rƒ((s/usr/lib/python2.6/urlparse.pyR=s$@s™
      http://a/b/c/d

      g:h        = <URL:g:h>
      http:g     = <URL:http://a/b/c/g>
      http:      = <URL:http://a/b/c/d>
      g          = <URL:http://a/b/c/g>
      ./g        = <URL:http://a/b/c/g>
      g/         = <URL:http://a/b/c/g/>
      /g         = <URL:http://a/g>
      //g        = <URL:http://g>
      ?y         = <URL:http://a/b/c/d?y>
      g?y        = <URL:http://a/b/c/g?y>
      g?y/./x    = <URL:http://a/b/c/g?y/./x>
      .          = <URL:http://a/b/c/>
      ./         = <URL:http://a/b/c/>
      ..         = <URL:http://a/b/>
      ../        = <URL:http://a/b/>
      ../g       = <URL:http://a/b/g>
      ../..      = <URL:http://a/>
      ../../g    = <URL:http://a/g>
      ../../../g = <URL:http://a/../g>
      ./../g     = <URL:http://a/b/g>
      ./g/.      = <URL:http://a/b/c/g/>
      /./g       = <URL:http://a/./g>
      g/./h      = <URL:http://a/b/c/g/h>
      g/../h     = <URL:http://a/b/c/h>
      http:g     = <URL:http://a/b/c/g>
      http:      = <URL:http://a/b/c/d>
      http:?y         = <URL:http://a/b/c/d?y>
      http:g?y        = <URL:http://a/b/c/g?y>
      http:g?y/./x    = <URL:http://a/b/c/g?y/./x>
c
Csxddk}d}|ido7|id}|djo
|i}qt|ƒ}nGyddkl}Wn#tj
oddkl}nX|tƒ}xÔ|D]Ì}|iƒ}|pq¤n|d}t	|ƒ}d||fGHt
||ƒ}	|p
|	}nd|	}
d	||
fGHt|ƒd
jo;|ddjo*|
|djod
G|dGdGHqpq¤q¤WdS(NiÿÿÿÿRit-(tStringIOis
%-10s : %ss<URL:%s>s
%-10s = %siR…itEXPECTEDs
!!!!!!!!!!(tsystargvtstdintopent	cStringIOR’tImportErrort
test_inputR(RRRI(R”RbtfntfpR’tlinetwordsR>tpartstabstwrapped((s/usr/lib/python2.6/urlparse.pyttestˆs8





$t__main__N(%R4t__all__R_R]tnon_hierarchicalR<RXRWRVRUR R"tobjectR#tcollectionsR6R7R:tTrueRR=RORRRRRRtrangeRvtupdateR|RRRšR¢R2(((s/usr/lib/python2.6/urlparse.pyt<module>sX	)""		,	
	
9		
I	


ACC SHELL 2018