PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  oY@sdZddlZddlZddlZddddddd d d d d ddddddddddgZddddddddd d!d"d#d$d%d&d'd(d)d*gZdddddd+dddd"d d!d,d#d$d%d-d'd(d&d.d/d0d)d*gZddd1d#ddd d!d$d%d2d3d"d&d4gZdd1d5d6d+ddd,d2d3g Zddddd d!d"dd$d%d2d3g Z ddd1ddd6ddd d!d,dd#g Z d7Z d8Z iZ d9d:Zd;Zd<Zd=d>Zeed?d@ZeedAdBZdCdDZGdEdFdFeZGdGdHdHeZGdIdJdJeZGdKdLdLeeZGdMdNdNeeZddOlmZeddPZeddQZeddRZeZGdSddeeZ GdTddeeZ!GdUddeeZ"GdVddeeZ#GdWddeeZ$GdXddeeZ%dYdZZ&e&[&dd[d\dZ'd]d^Z(dd_d`Z)dd[dadZ*dbdZ+dcdZ,d[dddZ-dedZ.dfZ/da0dgdZ1ej2dhZ3didjdkdZ4dldldidjdmd Z5dldldidjdnd Z6didjdodZ7e8dpZ9e:e9Z;iZ<Gdqdrdrej=Z>dsdddtd Z?ddddud Z@dsdvdZAdlddde@dwd ZBdxdyZCdzd{ZDdaEd|d}ZFdaGd~dZHddZIddZJdaKddZLdddZMddZNddZOddZPddZQdS)acParse (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. Zawinski, 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. Nurlparse urlunparseurljoin urldefragurlsplit urlunsplit urlencodeparse_qs parse_qslquote quote_plusquote_from_bytesunquote unquote_plusunquote_to_bytes DefragResult ParseResult SplitResultDefragResultBytesParseResultBytesSplitResultBytesZftphttpZgopherZnntpimapZwaisfileZhttpsZshttpZmmsZprosperoZrtspZrtspuZsftpZsvnzsvn+sshZwsZwssZtelnetZsnewsZrsyncZnfsZgitzgit+sshZhdlZsipZsipsZtelZmailtoZnewszAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.cCstjtjdS)z,Clear the parse cache and the quoters cache.N) _parse_cacheclear _safe_quotersrr$/opt/python35/lib/python3.5/parse.py clear_cacheSs r!asciistrictcCs|S)Nr)objrrr _noopbsr%cCs|j||S)N)encode)r$encodingerrorsrrr _encode_resultesr)cs tfdd|DS)Nc3s-|]#}|r!|jndVqdS)rN)decode).0x)r'r(rr ksz_decode_args..)tuple)argsr'r(r)r'r(r _decode_argsisr0cGswt|dt}x?|ddD]-}|r$t|t|kr$tdq$W|rf|tfSt|tfS)Nrz$Cannot mix str and non-str arguments) isinstancestr TypeErrorr%r0r))r/Z str_inputargrrr _coerce_argsms r6c@s.eZdZdZfZddddZdS)_ResultMixinStrz>Standard approach to encoding parsed results from str to bytesr"r#cs#|jfdd|DS)Nc3s!|]}|jVqdS)N)r&)r+r,)r'r(rr r-sz)_ResultMixinStr.encode..)_encoded_counterpart)selfr'r(r)r'r(r r&sz_ResultMixinStr.encodeN)__name__ __module__ __qualname____doc__ __slots__r&rrrr r7~s r7c@s.eZdZdZfZddddZdS)_ResultMixinBytesz>Standard approach to decoding parsed results from bytes to strr"r#cs#|jfdd|DS)Nc3s!|]}|jVqdS)N)r*)r+r,)r'r(rr r-sz+_ResultMixinBytes.decode..)_decoded_counterpart)r9r'r(r)r'r(r r*sz_ResultMixinBytes.decodeN)r:r;r<r=r>r*rrrr r?s r?c@sdeZdZdZfZeddZeddZeddZedd Z d S) _NetlocResultMixinBasezHShared methods for the parsed result objects containing a netloc elementcCs |jdS)Nr) _userinfo)r9rrr usernamesz_NetlocResultMixinBase.usernamecCs |jdS)Nr1)rB)r9rrr passwordsz_NetlocResultMixinBase.passwordcCs8|jd}|sd}n|dk r4|j}|S)Nr) _hostinfolower)r9hostnamerrr rGs     z_NetlocResultMixinBase.hostnamecCsL|jd}|dk rHt|d}d|ko?dknsHdS|S)Nr1 ri)rEint)r9portrrr rJs   z_NetlocResultMixinBase.portN) r:r;r<r=r>propertyrCrDrGrJrrrr rAs  rAc@s:eZdZfZeddZeddZdS)_NetlocResultMixinStrcCsb|j}|jd\}}}|rN|jd\}}}|sXd}n d}}||fS)N@:)netloc rpartition partition)r9rOuserinfo have_infohostinforC have_passwordrDrrr rBs   z_NetlocResultMixinStr._userinfocCs|j}|jd\}}}|jd\}}}|rr|jd\}}}|jd\}}}n|jd\}}}|sd}||fS)NrM[]rN)rOrPrQ)r9rO_rT have_open_br bracketedrGrJrrr rEs z_NetlocResultMixinStr._hostinfoN)r:r;r<r>rKrBrErrrr rLs  rLc@s:eZdZfZeddZeddZdS)_NetlocResultMixinBytescCsb|j}|jd\}}}|rN|jd\}}}|sXd}n d}}||fS)N@:)rOrPrQ)r9rOrRrSrTrCrUrDrrr rBs   z!_NetlocResultMixinBytes._userinfocCs|j}|jd\}}}|jd\}}}|rr|jd\}}}|jd\}}}n|jd\}}}|sd}||fS)Nr\[]r])rOrPrQ)r9rOrXrTrYrZrGrJrrr rEs z!_NetlocResultMixinBytes._hostinfoN)r:r;r<r>rKrBrErrrr r[s  r[) namedtuplez url fragmentz!scheme netloc path query fragmentz(scheme netloc path params query fragmentc@s"eZdZfZddZdS)rcCs&|jr|jd|jS|jSdS)N#)fragmenturl)r9rrr geturls zDefragResult.geturlN)r:r;r<r>rdrrrr rs c@s"eZdZfZddZdS)rcCs t|S)N)r)r9rrr rdszSplitResult.geturlN)r:r;r<r>rdrrrr rs c@s"eZdZfZddZdS)rcCs t|S)N)r)r9rrr rdszParseResult.geturlN)r:r;r<r>rdrrrr rs c@s"eZdZfZddZdS)rcCs&|jr|jd|jS|jSdS)N#)rbrc)r9rrr rd s zDefragResultBytes.geturlN)r:r;r<r>rdrrrr r s c@s"eZdZfZddZdS)rcCs t|S)N)r)r9rrr rdszSplitResultBytes.geturlN)r:r;r<r>rdrrrr rs c@s"eZdZfZddZdS)rcCs t|S)N)r)r9rrr rdszParseResultBytes.geturlN)r:r;r<r>rdrrrr rs cCsNttfttfttff}x&|D]\}}||_||_q(WdS)N)rrrrrrr8r@)Z _result_pairsZ_decodedZ_encodedrrr _fix_result_transcodings    rfTc Cst||\}}}t|||}|\}}}}}|tkrld|krlt|\}}nd}t||||||} || S)a#Parse a URL into 6 components: :///;?# 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.;r)r6r uses_params _splitparamsr) rcschemeallow_fragments_coerce_resultZ splitresultrOqueryrbparamsresultrrr r)scCsqd|kr@|jd|jd}|dkrO|dfSn|jd}|d|||ddfS)N/rgrrr1)findrfind)rcirrr ri9s    ricCsht|}x;dD]3}|j||}|dkrt||}qW|||||dfS)Nz/?#r)lenrqmin)rcstartdelimcZwdelimrrr _splitnetlocBs    ryc Cs$t||\}}}t|}|||t|t|f}tj|d}|rg||Stttkrtd}}}|jd} | dkrC|d| dkr|d| j }|| dd}|dddkrPt |d\}}d |kr,d |ksDd |krPd |krPt d |rzd |krz|j d d\}}d |kr|j d d\}}t |||||} | t|<|| Sxv|d| D]} | tkrPqW|| dd} | s&tdd| DrC|d| j | }}|dddkrt |d\}}d |krd |ksd |krd |krt d |rd |kr|j d d\}}d |kr|j d d\}}t |||||} | t|<|| S)aParse a URL into 5 components: :///?# 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.NrrNrrr1z//rVrWzInvalid IPv6 URLra?css|]}|dkVqdS) 0123456789Nr)r+rxrrr r-qszurlsplit..)r6booltypergetrtMAX_CACHE_SIZEr!rqrFry ValueErrorsplitr scheme_charsany) rcrjrkrlkeycachedrOrmrbrsvrxrestrrr rJsX !           cCsVt|\}}}}}}}|r7d||f}|t|||||fS)zPut 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).z%s;%s)r6r) componentsrjrOrcrnrmrbrlrrr rs!cCst|\}}}}}}|sL|r|tkr|dddkr|rr|dddkrrd|}d|p~d|}|r|d|}|r|d|}|r|d |}||S) akCombine 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).Nrzz//r1rprrNr{ra)r6 uses_netloc)rrjrOrcrmrbrlrrr rs. c CsR|s |S|s|St||\}}}t|d|\}}}}}} t|||\} } } } }}| |ks| tkr||S| tkr| r|t| | | | ||fS|} | r| r|} |} |s|}|t| | | | ||fS|jd}|ddkr>|d=| dddkrf| jd}n6|| jd}td|dd |dd  b'abc def'.zutf-8%r1rNcSsFi|]<}tD]/}tt||dg||jqqS))_hexdigbytesrIr&)r+rbrrr s z$unquote_to_bytes..rz) rr2r3r&rtr _hextobyterKeyErrorr)stringbitsresritemrrr rs*       z([-]+)zutf-8replacecCsd|kr|j|S|dkr)d}|dkr;d}tj|}|dg}|j}xRtdt|dD]8}|t||j|||||dqyWdj|S) aReplace %xx escapes by their single-character equivalent. The optional encoding and errors parameters specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. By default, percent-encoded sequences are decoded with UTF-8, and invalid sequences are replaced by a placeholder character. unquote('abc%20def') -> 'abc def'. %Nzutf-8rrr1rzr)r_asciirerrangertrr*r)rr'r(rrrrsrrr rs      Fc Csli}t|||d|d|}xA|D]9\}}||krW||j|q+|g||ms zparse_qsl..&=r1rzzbad query field: %rrr+ r'r()r6rrtrrrr) rrrr'r(rlrrZ name_valueZnvrrrrr r Us,   cCs"|jdd}t|||S)zLike unquote(), but also replace plus signs by spaces, as required for unquoting HTML form values. unquote_plus('%7e/abc+def') -> '~/abc def' rr)rr)rr'r(rrr rssAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-c@s:eZdZdZddZddZddZdS) QuoterzA mapping from bytes (in range(0,256)) to strings. String values are percent-encoded byte values, unless the key < 128, and in the "safe" set (either the specified safe set, or default set). cCstj||_dS)zsafe: bytes object.N) _ALWAYS_SAFEunionsafe)r9rrrr __init__szQuoter.__init__cCsd|jjt|fS)Nz<%s %r>) __class__r:dict)r9rrr __repr__szQuoter.__repr__cCs8||jkrt|n dj|}|||<|S)Nz%{:02X})rchrformat)r9rrrrr __missing__s* zQuoter.__missing__N)r:r;r<r=rrrrrrr rs   rrpcCst|trR|s|S|dkr+d}|dkr=d}|j||}n0|dk rjtd|dk rtdt||S)aquote('abc def') -> 'abc%20def' Each part of a URL, e.g. the path info, the query, etc., has a different set of reserved characters that must be quoted. RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax lists the following reserved characters. reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," Each of these characters is reserved in some component of a URL, but not necessarily in all of them. By default, the quote function is intended for quoting the path section of a URL. Thus, it will not encode '/'. This character is reserved, but in typical usage the quote function is being called on a path where the existing slash characters are used as reserved characters. string and safe may be either str or bytes objects. encoding and errors must not be specified if string is a bytes object. The optional encoding and errors parameters specify how to deal with non-ASCII characters, as accepted by the str.encode method. By default, encoding='utf-8' (characters are encoded with UTF-8), and errors='strict' (unsupported characters raise a UnicodeEncodeError). Nzutf-8r#z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r2r3r&r4r )rrr'r(rrr r s      cCst|trd|ks6t|trId|krIt||||St|trad}nd}t|||||}|jddS)zLike quote(), but also replace ' ' with '+', as required for quoting HTML form values. Plus signs in the original string are escaped unless they are included in safe. It also does not have safe default to '/'. r r)r2r3rr r)rrr'r(Zspacerrr r s c st|ttfs!td|s+dSt|trO|jdd}ntdd|D}|jt|s|jSyt |Wn)t k rt |j t |<YnXdj fdd|DS)zLike quote(), but accepts a bytes object rather than a str, and does not perform string-to-bytes encoding. It always returns an ASCII string. quote_from_bytes(b'abc def?') -> 'abc%20def%3f' z!quote_from_bytes() expected bytesrr"ignorecSs"g|]}|dkr|qS)r)r+rxrrr rs z$quote_from_bytes..csg|]}|qSrr)r+char)quoterrr rs )r2r bytearrayr4r3r&rstrip_ALWAYS_SAFE_BYTESr*rrr __getitem__r)bsrr)rr r s   cCst|dr|j}niy*t|rGt|dt rGtWn<tk rtj\}}}tdj|YnXg} |s:x |D]\} } t| t r|| |} n|t | |||} t| t r|| |} n|t | |||} | j | d| qWn|xy|D]q\} } t| t rn|| |} n|t | |||} t| t r|| |} | j | d| qAt| t r|| |||} | j | d| qAyt| } WnBtk rO|t | |||} | j | d| YqAXx_| D]W} t| t r~|| |} n|t | |||} | j | d| qWWqAWdj | S)a^Encode a dict or sequence of two-element tuples into a URL query string. If any values in the query arg are sequences and doseq is true, each sequence element is converted to a separate parameter. If the query arg is a sequence of two-element tuples, the order of the parameters in the output will match the order of parameters in the input. The components of a query arg may each be either a string or a bytes type. The safe, encoding, and errors parameters are passed down to the function specified by quote_via (encoding and errors only if a component is a str). itemsrz1not a valid non-string sequence or mapping objectrr) hasattrrrtr2r.r4sysexc_infowith_tracebackrr3rr)rmZdoseqrr'r(Z quote_viaZtyZvatblkrr,Zeltrrr rsP      c Cs[t|trWy|jdj}Wn,tk rVtdt|dYnX|S)zto_bytes(u"URL") --> 'URL'.ASCIIzURL z contains non-ASCII characters)r2r3r&r* UnicodeErrorrepr)rcrrr to_bytesNs rcCst|j}|dddkrT|dddkrT|ddj}|dddkr|ddj}|S) z8unwrap('') --> 'type://host/path'.Nr1<>zURL:rr)r3strip)rcrrr unwrap[s ,rcCsbtdkr!tjdtjatj|}|rX|j\}}|j|fSd|fS)z:splittype('type:opaquestring') --> 'type', 'opaquestring'.Nz ([^/:]+):(.*)) _typeprogrecompileDOTALLmatchgroupsrF)rcrrjdatarrr splittypeds rcCs|tdkr!tjdtjatj|}|rr|j\}}|rh|ddkrhd|}||fSd|fS)z;splithost('//host[:port]/path') --> 'host[:port]', '/path'.Nz//([^/#?]*)(.*)rrp) _hostprogrrrrr)rcrZ host_portrrrr splithostqs   rcCs.|jd\}}}|r$|nd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.rMN)rP)hostuserrwrrr splitusersrcCs.|jd\}}}||r'|ndfS)z/splitpasswd('user:passwd') -> 'user', 'passwd'.rNN)rQ)rrwZpasswdrrr splitpasswdsrcCsbtdkr!tjdtjatj|}|rX|j\}}|rX||fS|dfS)z*splitport('host:port') --> 'host', 'port'.Nz(.*):([0-9]*)$) _portprogrrrrr)rrrJrrr splitports  rr1c Csl|jd\}}}|s'|}n;|rbyt|}Wntk rWd}YnX||fS||fS)zSplit host and port, returning numeric port. Return given default port if no ':' found; defaults to -1. Return numerical port if a valid number are found after ':'. Return None if ':' but not a valid number.rNN)rPrIr)rZdefportrwrJZnportrrr splitnports    rcCs2|jd\}}}|r(||fS|dfS)z/splitquery('/path?query') --> '/path', 'query'.r{N)rP)rcrrwrmrrr splitquerys rcCs2|jd\}}}|r(||fS|dfS)z)splittag('/path#tag') --> '/path', 'tag'.raN)rP)rcrrwtagrrr splittags rcCs'|jd}|d|ddfS)zksplitattr('/path;attr1=value1;attr2=value2;...') -> '/path', ['attr1=value1', 'attr2=value2', ...].rgrr1N)r)rcZwordsrrr splitattrsrcCs.|jd\}}}||r'|ndfS)z-splitvalue('attr=value') --> 'attr', 'value'.rN)rQ)attrrwrrrr splitvaluesrr)Rr=rr collections__all__rrrhZnon_hierarchicalZ uses_queryZ uses_fragmentrrrr!Z_implicit_encodingZ_implicit_errorsr%r)r0r6objectr7r?rArLr[r`Z_DefragResultBaseZ_SplitResultBaseZ_ParseResultBaseZ ResultBaserrrrrrrfrriryrrrrrrrrrrrr r r frozensetrrrr defaultdictrr r r rrrrrrrrrrrrrrrrrrrr s                  8 E  "/  , O