ok

Mini Shell

Direktori : /proc/self/root/proc/thread-self/root/proc/self/root/opt/alt/python27/lib64/python2.7/
Upload File :
Current File : //proc/self/root/proc/thread-self/root/proc/self/root/opt/alt/python27/lib64/python2.7/urlparse.pyo

�
�[
bc@s�dZddlZddddddd	d
gZddd
ddddddddddddddgZddd
ddddddddddddddddddd d!gZdd"dddddddd#d$dddd%gZd
d"d&d'ddddd#d$g
Zddddddd
ddd#d$dgZdd"dd
d'ddddddddg
Zd(Z	d)Z
iZd*�Zd+e
fd,��YZdd-lmZd.ed.d/�efd0��YZd1ed1d2�efd3��YZded4�Zd5�Zd6d7�Zd8�Zded9�Zd:�Zd;�Zed<�Zd=�ZyeWnek
rnd>�Zn
Xd?�Zd@Z e!dA�e D��Z"ej#dB�Z$dC�Z%d6d6ddD�Z'd6d6ddE�Z(dS(FscParse (absolute and relative) URLs.

urlparse module is based upon the following RFC specifications.

RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L.  Masinter, January 2005.

RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, December 1999.

RFC 2396:  "Uniform Resource Identifiers (URI)": Generic Syntax by T.
Berners-Lee, R. Fielding, and L. Masinter, August 1998.

RFC 2368: "The mailto URL scheme", by P.Hoffman , L Masinter, J. Zwinski, July 1998.

RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June
1995.

RFC 1738: "Uniform Resource Locators (URL)" by T. Berners-Lee, L. Masinter, M.
McCahill, December 1994

RFC 3986 is considered the current standard and any future changes to
urlparse module should conform with it.  The urlparse module is
currently not entirely compliant with this RFC due to defacto
scenarios for parsing, and for backward compatibility purposes, some
parsing quirks from older RFCs are retained. The testcases in
test_urlparse.py provides a good indicator of parsing behavior.

i����Nturlparset
urlunparseturljoint	urldefragturlsplitt
urlunsplittparse_qst	parse_qsltftpthttptgophertnntptimaptwaistfilethttpstshttptmmstprosperotrtsptrtsputtsftptsvnssvn+sshttelnettsnewstrsynctnfstgitsgit+sshthdltsiptsipstteltmailtotnewssAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.icCstj�dS(sClear the parse cache.N(t_parse_cachetclear(((s-/opt/alt/python27/lib64/python2.7/urlparse.pytclear_cacheDstResultMixincBsJeZdZed��Zed��Zed��Zed��ZRS(s-Shared methods for the parsed result objects.cCsX|j}d|krT|jdd�d}d|krP|jdd�d}n|SdS(Nt@iit:(tnetloctrsplittsplittNone(tselfR)tuserinfo((s-/opt/alt/python27/lib64/python2.7/urlparse.pytusernameLs	cCsR|j}d|krN|jdd�d}d|krN|jdd�dSndS(NR'iiR((R)R*R+R,(R-R)R.((s-/opt/alt/python27/lib64/python2.7/urlparse.pytpasswordVs	cCs�|jjd�d}d|krId|krI|jd�ddj�Sd|krl|jd�dj�S|dkr|dS|j�SdS(	NR'i����t[t]iiR(R(R)R+tlowerR,(R-R)((s-/opt/alt/python27/lib64/python2.7/urlparse.pythostname_scCs�|jjd�djd�d}d|kr}|jd�d}|r}t|d�}d|kondknrz|Sq}ndS(	NR'i����R2R(ii
ii��(R)R+tintR,(R-R)tport((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR6ks#
(t__name__t
__module__t__doc__tpropertyR/R0R4R6(((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR&Is

	(t
namedtupletSplitResults!scheme netloc path query fragmentcBseZdZd�ZRS(cCs
t|�S(N(R(R-((s-/opt/alt/python27/lib64/python2.7/urlparse.pytgeturl}s((R7R8t	__slots__R=(((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR<ystParseResults(scheme netloc path params query fragmentcBseZdZd�ZRS(cCs
t|�S(N(R(R-((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR=�s((R7R8R>R=(((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR?�scCsst|||�}|\}}}}}|tkrTd|krTt|�\}}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-/opt/alt/python27/lib64/python2.7/urlparse.pyR�scCsed|kr@|jd|jd��}|dkrO|dfSn|jd�}|| ||dfS(Nt/R@iRi(tfindtrfind(RCti((s-/opt/alt/python27/lib64/python2.7/urlparse.pyRB�s
icCsbt|�}x>dD]6}|j||�}|dkrt||�}qqW|||!||fS(Ns/?#i(tlenRKtmin(RCtstarttdelimtctwdelim((s-/opt/alt/python27/lib64/python2.7/urlparse.pyt_splitnetloc�s
cCs�|st|t�rdSddl}|jdd�}|jdd�}|jdd�}|jdd�}|jd|�}||kr�dSx-dD]%}||kr�td	|��q�q�WdS(
Ni����u@uu:u#u?tNFKCs/?#@:s>netloc %r contains invalid characters under NFKC normalization(t
isinstancetunicodetunicodedatatreplacet	normalizet
ValueError(R)RXtntnetloc2RR((s-/opt/alt/python27/lib64/python2.7/urlparse.pyt_checknetloc�s
cCs�t|�}|||t|�t|�f}tj|d�}|rI|Stt�tkret�nd}}}|jd�}|dkr|| dkr�|| j	�}||d}|d dkr#t
|d�\}}d|kr�d	|ksd	|kr#d|kr#td
��q#n|rPd|krP|jdd�\}}nd|krw|jdd�\}}nt
|�t|||||�}	|	t|<|	Sxj|| D]}
|
tkr�Pq�q�W||d}|s�td
�|D��r|| j	�|}}qn|d dkr{t
|d�\}}d|krQd	|ksid	|kr{d|kr{td
��q{n|r�d|kr�|jdd�\}}nd|kr�|jdd�\}}nt
|�t|||||�}	|	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//R1R2sInvalid IPv6 URLt#t?css|]}|dkVqdS(t
0123456789N((t.0RR((s-/opt/alt/python27/lib64/python2.7/urlparse.pys	<genexpr>�sN(tboolttypeR#tgetR,RNtMAX_CACHE_SIZER%RKR3RTR[R+R^R<tscheme_charstany(RCRDREtkeytcachedR)RGRHRMtvRRtrest((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR�sZ!




cCsJ|\}}}}}}|r1d||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(tdataRDR)RCRIRGRH((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR�scCs�|\}}}}}|s=|rw|tkrw|d dkrw|r`|d dkr`d|}nd|pld|}n|r�|d|}n|r�|d|}n|r�|d|}n|S(	skCombine the elements of a tuple as returned by urlsplit() into a
    complete URL as a string. The data argument can be any five-item iterable.
    This may result in a slightly different, but equivalent URL, if the URL that
    was parsed originally had unnecessary delimiters (for example, a ? with an
    empty query; the RFC states that these are equivalent).is//iRJRR(R`R_(tuses_netloc(RmRDR)RCRGRH((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR�s(
cCsh|s
|S|s|St|d|�\}}}}}}t|||�\}	}
}}}
}|	|kst|	tkrx|S|	tkr�|
r�t|	|
|||
|f�S|}
n|d dkr�t|	|
|||
|f�S|r |r |}|}|
s|}
nt|	|
|||
|f�S|jd�d |jd�}|ddkr]d|d<nxd|kr||jd�q`Wxrd}t|�d}xU||kr�||dkr�||dd	kr�||d|d5Pn|d}q�WPq�W|ddgkrd|d<n2t|�dkrC|ddkrCdg|d)nt|	|
dj|�||
|f�S(
saJoin a base URL and a possibly relative URL to form an absolute
    interpretation of the latter.RiRJi����t.s..ii����(Rs..(Rt
uses_relativeRnRR+tremoveRNtjoin(tbaseRCREtbschemetbnetloctbpathtbparamstbqueryt	bfragmentRDR)tpathRIRGRHtsegmentsRMR\((s-/opt/alt/python27/lib64/python2.7/urlparse.pyRsX$$		 

"cCs`d|krRt|�\}}}}}}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.
    R_RN(RR(RCtsR\tptatqtfragtdefrag((s-/opt/alt/python27/lib64/python2.7/urlparse.pyRDs

cCsdS(Ni((tx((s-/opt/alt/python27/lib64/python2.7/urlparse.pyt_is_unicodeUscCs
t|t�S(N(RVRW(R�((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR�Xst0123456789ABCDEFabcdefccs?|]5}tD](}||tt||d��fVq
qdS(iN(t_hexdigtchrR5(RbR~tb((s-/opt/alt/python27/lib64/python2.7/urlparse.pys	<genexpr>ass([-]+)cCsOt|�r�d|kr|Stj|�}|dg}|j}xUtdt|�d�D];}|tt||��jd��|||d�qZWdj	|�S|jd�}t|�dkr�|S|dg}|j}x^|dD]R}y$|t
|d �||d�Wq�tk
r=|d�||�q�Xq�Wdj	|�S(s"unquote('abc%20def') -> 'abc def'.t%iiitlatin1R(R�t_asciireR+tappendtrangeRNtunquotetstrtdecodeRrt	_hextochrtKeyError(R|tbitstresR�RMtitem((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR�es.
	#

	

cCs]i}xPt||||�D]9\}}||krH||j|�q|g||<qW|S(s2Parse a query given as a string argument.

        Arguments:

        qs: percent-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            percent-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.

        max_num_fields: int. If set, then throws a ValueError if there
            are more than n fields read by parse_qsl().
    (RR�(tqstkeep_blank_valueststrict_parsingtmax_num_fieldstdicttnametvalue((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR�sc
Csn|dk	rJd|jd�|jd�}||krJtd��qJng|jd�D]"}|jd�D]}|^qmqZ}g}x�|D]�}	|	r�|r�q�n|	jdd�}
t|
�dkr|r�td|	f�n|r�|
jd�qq�nt|
d�s|r�t|
d	jd
d��}t|
djd
d��}|j||f�q�q�W|S(
sParse a query given as a string argument.

    Arguments:

    qs: percent-encoded query string to be parsed

    keep_blank_values: flag indicating whether blank values in
        percent-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.

    max_num_fields: int. If set, then throws a ValueError if there
        are more than n fields read by parse_qsl().

    Returns a list, as G-d intended.
    it&R@sMax number of fields exceededt=isbad query field: %rRit+t N(R,tcountR[R+RNR�R�RY(
R�R�R�R�t
num_fieldsts1ts2tpairstrt
name_valuetnvR�R�((s-/opt/alt/python27/lib64/python2.7/urlparse.pyR�s* 8
()R9tret__all__RpRnRAtnon_hierarchicalt
uses_queryt
uses_fragmentRgRfR#R%tobjectR&tcollectionsR;R<R?tTrueRRBRTR^RRRRRRWt	NameErrorR�R�R�R�tcompileR�R�R,RR(((s-/opt/alt/python27/lib64/python2.7/urlparse.pyt<module>sd	.""			9	
	4	

		
	

Zerion Mini Shell 1.0