Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/werkzeug/__pycache__/urls.cpython-37.pyc

517 lines
35 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
<00>/<2F>]<5D><><00>@sVdZddlZddlZddlZddlmZddlmZddlmZddlm Z ddlm
Z
dd lm Z dd
lm Z dd lm Z dd lmZdd lmZddlmZddlmZe<03>d<10>Zeed<11><01>ZdZedd<14>eD<00><01>Zdd<16>ed<17>D<00>Zeeddddddg<05><02>ZGdd<1F>de<1D>ZeGd d!<21>d!e<1E><03>ZGd"d#<23>d#e<1E>Z e<15>eiZ!d`d%d&<26>Z"d'd(<28>Z#dad)d*<2A>Z$dbd,d-<2D>Z%dcd1d2<64>Z&e&<26>Z'e&d3d4d5<64>Z(d6d7<64>Z)ddd8d9<64>Z*ded:d;<3B>Z+d<d=<3D>Z,dfd?d@<40>Z-dgdAdB<64>Z.dhdCdD<64>Z/d$<24>0dEd<16>edF<64>D<00><01>Z1dGdH<64>Z2e<01>3dIe2<65>didJdK<64>Z4dLZ5djdNdO<64>Z6dkdQdR<64>Z7dldSdT<64>Z8dUdV<64>Z9dmdXdY<64>Z:dndZd[<5B>Z;dod\d]<5D>Z<Gd^d_<64>d_e=<3D>Z>dS)pa<70>
werkzeug.urls
~~~~~~~~~~~~~
``werkzeug.urls`` used to provide several wrapper functions for Python 2
urlparse, whose main purpose were to work around the behavior of the Py2
stdlib and its lack of unicode support. While this was already a somewhat
inconvenient situation, it got even more complicated because Python 3's
``urllib.parse`` actually does handle unicode properly. In other words,
this module would wrap two libraries with completely different behavior. So
now this module contains a 2-and-3-compatible backport of Python 3's
``urllib.parse``, which is mostly API-compatible.
:copyright: 2007 Pallets
:license: BSD-3-Clause
<EFBFBD>N)<01>
namedtuple<EFBFBD>)<01>fix_tuple_repr)<01>implements_to_string)<01>make_literal_wrapper)<01>normalize_string_tuple)<01>PY2)<01> text_type)<01> to_native)<01>
to_unicode)<01>try_coerce_native)<01> _decode_idna)<01> _encode_idnaz^[a-zA-Z0-9+-.]+$sBabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~<7E>0123456789ABCDEFabcdefccs2|]*}tD] }||<00><01>t||d<00>fVq
qdS)<02>N)<03>
_hexdigits<EFBFBD>encode<64>int)<03>.0<EFBFBD>a<>b<>r<00>3/tmp/pip-install-c3kgu56x/Werkzeug/werkzeug/urls.py<70> <genexpr>2srcCsg|]}d|<00>d<01><01>qS)z%%%02X<32>ascii)r)r<00>charrrr<00>
<listcomp>4sr<00><00> _URLTuple<6C>scheme<6D>netloc<6F>path<74>query<72>fragmentc@s<>eZdZdZdZdd<04>Zedd<06><00>Zedd<08><00>Zed d
<EFBFBD><00>Z ed d <0C><00>Z
ed d<0E><00>Z edd<10><00>Z edd<12><00>Z edd<14><00>Zdd<16>Zdd<18>Zdd<1A>Zdd<1C>Zdd<1E>Zdd <20>Zd*d"d#<23>Zd$d%<25>Zd&d'<27>Zd(d)<29>Zd!S)+<2B>BaseURLz7Superclass of :py:class:`URL` and :py:class:`BytesURL`.rcKs |jf|<01>S)z<>Return an URL with the same values, except for those parameters
given new values by whichever keyword arguments are specified.)<01>_replace)<02>self<6C>kwargsrrr<00>replaceAszBaseURL.replacecCs |<00><00>dS)z<>The host part of the URL if available, otherwise `None`. The
host is either the hostname or the IP address mentioned in the
URL. It will not contain the port.
r)<01> _split_host)r&rrr<00>hostFsz BaseURL.hostcCsR|j}|dk rFt|t<02>rFy t|<01>}Wn tk
rD|<01>dd<03>}YnXt|dd<03>S)a Works exactly like :attr:`host` but will return a result that
is restricted to ASCII. If it finds a netloc that is not ASCII
it will attempt to idna decode it. This is useful for socket
operations when the URL might include internationalized characters.
Nr<00>ignore)r*<00>
isinstancer r<00> UnicodeErrorrr
)r&<00>rvrrr<00>
ascii_hostNs zBaseURL.ascii_hostc CsRy4tt|<00><02>d<00><01>}d|kr*dkr2nn|SWnttfk
rLYnXdS)z}The port in the URL as an integer if it was present, `None`
otherwise. This does not fill in default ports.
rri<><69>N)rr
r)<00>
ValueError<EFBFBD> TypeError)r&r.rrr<00>port]s z BaseURL.portcCs |<00><00>dS)zSThe authentication part in the URL if available, `None`
otherwise.
r)<01> _split_netloc)r&rrr<00>authisz BaseURL.authcCs |<00><00>d}|dk rt|<01>SdS)z<>The username if it was part of the URL, `None` otherwise.
This undergoes URL decoding and will always be a unicode string.
rN)<02> _split_auth<74>_url_unquote_legacy)r&r.rrr<00>usernameps zBaseURL.usernamecCs |<00><00>dS)z<>The username if it was part of the URL, `None` otherwise.
Unlike :attr:`username` this one is not being decoded.
r)r5)r&rrr<00> raw_usernameyszBaseURL.raw_usernamecCs |<00><00>d}|dk rt|<01>SdS)z<>The password if it was part of the URL, `None` otherwise.
This undergoes URL decoding and will always be a unicode string.
rN)r5r6)r&r.rrr<00>password<72>s zBaseURL.passwordcCs |<00><00>dS)z<>The password if it was part of the URL, `None` otherwise.
Unlike :attr:`password` this one is not being decoded.
r)r5)r&rrr<00> raw_password<72>szBaseURL.raw_passwordcOst|jf|<01>|<02>S)z<>Decodes the query part of the URL. Ths is a shortcut for
calling :func:`url_decode` on the query argument. The arguments and
keyword arguments are forwarded to :func:`url_decode` unchanged.
)<02>
url_decoder")r&<00>argsr'rrr<00> decode_query<72>szBaseURL.decode_querycOstt|f|<01>|<02><01>S)z<>Joins this URL with another one. This is just a convenience
function for calling into :meth:`url_join` and then parsing the
return value again.
)<02> url_parse<73>url_join)r&r<r'rrr<00>join<69>sz BaseURL.joincCst|<00>S)z<>Returns a URL string or bytes depending on the type of the
information stored. This is just a convenience function
for calling :meth:`url_unparse` for this URL.
)<01> url_unparse)r&rrr<00>to_url<72>szBaseURL.to_urlcCsxt|jp
d<01>}d|krd|}|j}|dk r8d||f}d<02>tdt|jpJdd<06>t|jpXdd<06>g<02><02>}|rtd||f}|S)z&Decodes the netloc part into a string.<2E><00>:z[%s]Nz%s:%dz/:%@z%s@%s)r r*r2r@<00>filterr6r8r:)r&r.r2r4rrr<00> decode_netloc<6F>s  zBaseURL.decode_netloccCstt|<00><01>d<01><01>S)a*Returns a :class:`BytesURL` tuple that holds a URI. This will
encode all the information in the URL properly to ASCII using the
rules a web browser would follow.
It's usually more interesting to directly call :meth:`iri_to_uri` which
will return a string.
r)r><00>
iri_to_urir)r&rrr<00> to_uri_tuple<6C>szBaseURL.to_uri_tuplecCs tt|<00><01>S)aSReturns a :class:`URL` tuple that holds a IRI. This will try
to decode as much information as possible in the URL without
losing information similar to how a web browser does it for the
URL bar.
It's usually more interesting to directly call :meth:`uri_to_iri` which
will return a string.
)r><00>
uri_to_iri)r&rrr<00> to_iri_tuple<6C>s zBaseURL.to_iri_tupleNcCs:|jdkrdSt|j<02>}|jp d}|dkr>tjdkr:d}nd}|dkr<>|dd<07>dkr<>|dd <09><00><06>r<>|d d
<EFBFBD>d kr<>|dd <09>d |d
d<03>}|dd
<EFBFBD>d k}ddl}|<05>|<02>}|r<>|dkr<>|<02> d<0F><01>
dd<07>}t |<06>d kr<>|\}}n |d}d}n.|dk<02>rddl }|<07>|<02>}nt dt|<01><00><01>|dk<06>r2d}||fS)a@Returns a tuple with the location of the file in the form
``(server, location)``. If the netloc is empty in the URL or
points to localhost, it's represented as ``None``.
The `pathformat` by default is autodetection but needs to be set
when working with URLs of a specific system. The supported values
are ``'windows'`` when working with Windows or DOS paths and
``'posix'`` when working with posix paths.
If the URL does not point to a local file, the server and location
are both represented as ``None``.
:param pathformat: The expected format of the path component.
Currently ``'windows'`` and ``'posix'`` are
supported. Defaults to ``None`` which is
autodetect.
<20>file)NNN<4E>ntZwindows<77>posixr<00>/<2F><00>z|:rD)z\\\z///r<00>\rCzInvalid path format %s)z 127.0.0.1z::1<> localhost)r<00> url_unquoter!r <00>os<6F>name<6D>isalpha<68>ntpath<74>normpath<74>lstrip<69>split<69>len<65> posixpathr1<00>repr)r&Z
pathformatr!r*Z windows_sharerW<00>partsr\rrr<00>get_file_location<6F>s6



0
  

 
zBaseURL.get_file_locationcCs&|j|jkr|j<01>|jd<01>Sd|jfS)Nr)<03>_atr rZ)r&rrrr3 s zBaseURL._split_netloccCs4|<00><00>d}|sdS|j|kr&|dfS|<01>|jd<03>S)Nr)NNr)r3<00>_colonrZ)r&r4rrrr5s  
zBaseURL._split_authcCs<>|<00><00>d}|sdS|<01>|j<02>s@|j|kr8|<01>|jd<01>S|dfS|<01>|j<06>}|dkr\|dfS|d|<02>}||dd<00>}|<04>|j<03>r<>||dd<00>fS|dfS)Nr)NNr)r3<00>
startswith<EFBFBD> _lbracketrarZ<00>find<6E> _rbracket)r&r.<00>idxr*<00>restrrrr)s  
   zBaseURL._split_host)N)<19>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F> __slots__r(<00>propertyr*r/r2r4r7r8r9r:r=r@rBrFrHrJr_r3r5r)rrrrr$<s*     

<r$c@s>eZdZdZdZdZdZdZdZdd<08>Z d d
<EFBFBD>Z
dd d<0E>Z dS)<11>URLz<4C>Represents a parsed URL. This behaves like a regular tuple but
also has some extra attributes that give further insight into the
URL.
r<00>@rD<00>[<5B>]cCs|<00><00>S)N)rB)r&rrr<00>__str__;sz URL.__str__c
Cs<>|jpd}d|krd|}|j}|dk r4d||f}d<02>tdt|jpFdddd<08>t|jpXdddd<08>g<02><02>}|rxd ||f}t|<01>S)
z6Encodes the netloc part to an ASCII safe URL as bytes.rCrDz[%s]Nz%s:%dzutf-8<>strictz/:%z%s@%s)r/r2r@rE<00> url_quoter8r:r
)r&r.r2r4rrr<00> encode_netloc>s
  zURL.encode_netloc<6F>utf-8r(c Cs:t|j<01>d<01>|<00><03>|j<04>||<02>|j<05>||<02>|j<06>||<02><02>S)z<>Encodes the URL to a tuple made out of bytes. The charset is
only being used for the path, query and fragment.
r)<07>BytesURLrrrur!r"r#)r&<00>charset<65>errorsrrrrSs 
  z
URL.encodeN)rvr() rhrirjrkrlr`rarcrerrrurrrrrrn.srnc@s>eZdZdZdZdZdZdZdZdd<08>Z d d
<EFBFBD>Z
dd d<0E>Z dS)rwz!Represents a parsed URL in bytes.r<00>@<40>:<3A>[<5B>]cCs|<00><00><00>dd<02>S)Nzutf-8r()rB<00>decode)r&rrrrriszBytesURL.__str__cCs|jS)z&Returns the netloc unchanged as bytes.)r )r&rrrrulszBytesURL.encode_netloc<6F>utf-8r(c Cs:t|j<01>d<01>|<00><03>|j<04>||<02>|j<05>||<02>|j<06>||<02><02>S)z<>Decodes the URL to a tuple made out of strings. The charset is
only being used for the path, query and fragment.
r)rnrr~rFr!r"r#)r&rxryrrrr~ps 
  zBytesURL.decodeN)rr() rhrirjrkrlr`rarcrerrrur~rrrrrw`srwrCcs<>t|t<01>r|<00>d<01>}t<00>t<01>r(<28><00>d<01><01>tt<04><00><01><01>t|<00>d<02><01>}tt|d<03><02>}y t<08>}Wn2t k
r<EFBFBD><00>fdd<05>t
<EFBFBD> <0B>D<00>}t<08><YnXxV|D]N}|dd<06>}||kr<>|<03> ||<00>|<03> |dd<00><00>q<>|<03> d<07>|<03> |<05>q<>Wt|<03>S)Nzutf-8<>%<25>csi|]\}}|<02>kr||<01>qSrr)r<00>hr)<01>unsaferr<00>
<dictcomp><3E>sz%_unquote_to_bytes.<locals>.<dictcomp>rO<00>%)r,r r<00> frozenset<65> bytearray<61>iterrZ<00>next<78> _unquote_maps<70>KeyError<6F>
_hextobyte<EFBFBD>items<6D>append<6E>extend<6E>bytes)<07>stringr<67><00>groups<70>resultZ hex_to_byte<74>group<75>coder)r<>r<00>_unquote_to_bytes<65>s(



  

 
r<>ccs<>ddlm}||<00>}|r$t||d<03>}x`|D]X\}}|dkr<q*t|t<04>sTt|<04><01>|<01>}t|t<04>slt|<07><01>|<01>}t|<04>dt|<07>Vq*WdS)Nr)<01>iter_multi_items)<01>key<65>=)<08>datastructuresr<73><00>sortedr,r<>r r<00>_fast_url_quote_plus)<08>objrx<00> encode_keys<79>sortr<74>r<><00>iterable<6C>valuerrr<00>_url_encode_impl<70>s  

r<>cCs4yt|dd|d<03>Stk
r.t|d|d<05>SXdS)Nzutf-8rs)rxryr<><00>latin1)rxr<>)rSr-)r<>r<>rrrr6<00>sr6Tc s<>t|<00><01>t|t<02>}|dkr"<22>d<02>}<01>d<02>}}}|<00><03>d<03><01>}|dkr<>t<04>t|d|<07>dd<06><02>r<>||dd<01>}|r<>t<07>fdd <09>|D<00><01>r<>|d|<07><00><08>|}}|dd
<EFBFBD><00>d <0B>k<02>rJt |<00>} x.<2E>d <0C>D]"}
|<00>|
d
<EFBFBD>} | dkr<>t
| | <0B>} q<>W|d
| <09>|| d<01>}}<00>d <0A>|k<06>r&<26>d<0E>|k<07>sB<73>d<0E>|k<06>rJ<72>d <0A>|k<07>rJt d<0F><01>|<02>rr<72>d<10>|k<06>rr|<00> <0C>d<10>d<07>\}}<06>d<11>|k<06>r<>|<00> <0C>d<11>d<07>\}}|<03>r<>t nt} | |||||<06>S)aParses a URL from a string into a :class:`URL` tuple. If the URL
is lacking a scheme it can be provided as second argument. Otherwise,
it is ignored. Optionally fragments can be stripped from the URL
by setting `allow_fragments` to `False`.
The inverse of this function is :func:`url_unparse`.
:param url: the URL to parse.
:param scheme: the default schema to use if the URL is schemaless.
:param allow_fragments: if set to `False` a fragment will be removed
from the URL.
NrCrDrr()ryrc3s|]}|<01>d<00>kVqdS)<02>
0123456789Nr)r<00>c)<01>srrr<00>szurl_parse.<locals>.<genexpr>rOz//z/?#rprqzInvalid IPv6 URL<52>#<23>?)rr,r rd<00>
_scheme_re<EFBFBD>matchr
<00>any<6E>lowerr[<00>minr0rZrnrw) <0A>urlr<00>allow_fragmentsZ is_text_basedr r"r#<00>irg<00>delimr<6D><00>wdelimZ result_typer)r<>rr><00>s4 
" r><00>utf-8rs<00>/:cs<>t<00>t<01>r<16><00>||<01><02>t|t<01>r,|<03>||<01>}tt<04><00><01>tBtt|<03><01><00><00>fdd<02>td<03>D<00><01>tsp<73>fdd<05>}n <0C>fdd<05>}|S)a<>Precompile the translation table for a URL encoding function.
Unlike :func:`url_quote`, the generated function only takes the
string to quote.
:param charset: The charset to encode the result with.
:param errors: How to handle encoding errors.
:param safe: An optional sequence of safe characters to never encode.
:param unsafe: An optional sequence of unsafe characters to always encode.
cs$g|]}|<01>krt|<01>nd|<00>qS)z%%%02X)<01>chr)rr<>)<01>saferrr<00>sz(_make_fast_url_quote.<locals>.<listcomp>rcsd<01><00>fdd<03>|D<00><01>S)NrCcsg|] }<01>|<00>qSrr)rr<>)<01>tablerrr<00>sz7_make_fast_url_quote.<locals>.quote.<locals>.<listcomp>)r@)r<>)r<>rr<00>quote<74>sz#_make_fast_url_quote.<locals>.quotecsd<01><00>fdd<03>t|<00>D<00><01>S)NrCcsg|] }<01>|<00>qSrr)rr<>)r<>rrrsz7_make_fast_url_quote.<locals>.quote.<locals>.<listcomp>)r@r<>)r<>)r<>rrr<>s)r,r rr<>r<><00> _always_safe<66>ranger)rxryr<>r<>r<>r)r<>r<>r<00>_make_fast_url_quote<74>s
 
  r<><00> <20>+)r<>r<>cCst|<00><01>dd<02>S)Nr<4E>r<>)<02>_fast_quote_plusr()r<>rrrr<> sr<>cCs<>t|tttf<03>st|<00>}t|t<01>r.|<00>||<02>}t|t<01>rD|<03>||<02>}t|t<01>rZ|<04>||<02>}tt|<03><01>tBtt|<04><01>}t<03>}x2t|<00>D]&}||kr<>|<05>|<06>q<>|<05>t |<00>q<>Wt
t|<05><01>S)aDURL encode a single string with a given encoding.
:param s: the string to quote.
:param charset: the charset to be used.
:param safe: an optional sequence of safe characters.
:param unsafe: an optional sequence of unsafe characters.
.. versionadded:: 0.9.2
The `unsafe` parameter was added.
) r,r r<>r<>rr<>r<>r<>r<><00>
_bytetohexr
)r<>rxryr<>r<>r.rrrrrts 
 
 
  rtcCst||||dd<02><05>dd<02>S)z<>URL encode a single string with the given encoding and convert
whitespace to "+".
:param s: The string to quote.
:param charset: The charset to be used.
:param safe: An optional sequence of safe characters.
r<>r<>)rtr()r<>rxryr<>rrr<00>url_quote_plus-sr<>cCs<>t|<00>\}}}}}t|<01>}|d<01>}|s8|rv|<03>|d<02><01>rv|r\|dd<04>|d<02>kr\|d<02>|}|d<05>|pl|d<01>|}n |r<>||7}|r<>||d<06>|}|r<>||d<07>|}|r<>||d<08>|}|S) z<>The reverse operation to :meth:`url_parse`. This accepts arbitrary
as well as :class:`URL` tuples and returns a URL as a string.
:param components: the parsed URL as tuple which should be converted
into a URL string.
rCrNNrz//rDr<>r<>)rrrb)<08>
componentsrr r!r"r#r<>r<>rrrrA8s  rAr(cCs"t||<03>}|dk r|<04>||<02>}|S)a<>URL decode a single string with a given encoding. If the charset
is set to `None` no unicode decoding is performed and raw bytes
are returned.
:param s: the string to unquote.
:param charset: the charset of the query string. If set to `None`
no unicode decoding will take place.
:param errors: the error handling for the charset decoding.
N)r<>r~)r<>rxryr<>r.rrrrSVs
 rScCs0t|t<01>r|<00>dd<02>}n |<00>dd<04>}t|||<02>S)aURL decode a single string with the given `charset` and decode "+" to
whitespace.
Per default encoding errors are ignored. If you want a different behavior
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
:exc:`HTTPUnicodeError` is raised.
:param s: The string to unquote.
:param charset: the charset of the query string. If set to `None`
no unicode decoding will take place.
:param errors: The error handling for the `charset` decoding.
r<>r<><00>+<2B> )r,r r(rS)r<>rxryrrr<00>url_unquote_plusfs
 r<>cCs<>t||d<01><03>dd<03>}|<00>d<04>rN|dd<06><00><03>rN|dd<07>dkrNd |dd
<EFBFBD>}t|<00>}t|j|d d <0C>}t|j|d d <0C>}t|j |d d <0C>}t
t |j |<02> <0A>|||f<05><01>S)aSometimes you get an URL by a user that just isn't a real URL because
it contains unsafe characters like ' ' and so on. This function can fix
some of the problems in a similar way browsers handle data entered by the
user:
>>> url_fix(u'http://de.wikipedia.org/wiki/Elf (Begriffskl\xe4rung)')
'http://de.wikipedia.org/wiki/Elf%20(Begriffskl%C3%A4rung)'
:param s: the string with the URL to fix.
:param charset: The target charset for the URL if the url was given as
unicode string.
r(rQrNzfile://<2F><00><00>
)z:/z|/zfile:///Nz
/%+$!*'(),)r<>z :&%=+$!*'(),)r r(rbrVr>rtr!r<>r"r#r
rArru)r<>rxr<>r!<00>qs<71>anchorrrr<00>url_fixzs*r<>cCsg|]}|tkrt|<01><01>qSr)r<>r<>)rr<>rrrr<00>s<00><>cCs.t|j|j|j<03><00>}tr$|<01>d<01>}||jfS)zRUsed in :func:`uri_to_iri` after unquoting to re-quote any
invalid bytes.
zutf-8)<06>_fast_url_quote<74>object<63>start<72>endrr~)<02>e<>outrrr<00>_codec_error_url_quote<74>s
r<><00>werkzeug.url_quotecCsht|t<01>rt|<00>}tt||<01><02>}t|j||t<07>}t|j||t<07>}t|j ||t<07>}t|j
|<00> <0B>|||f<05>S)a<>Convert a URI to an IRI. All valid UTF-8 characters are unquoted,
leaving all reserved and invalid characters quoted. If the URL has
a domain, it is decoded from Punycode.
>>> uri_to_iri("http://xn--n3h.net/p%C3%A5th?q=%C3%A8ry%DF")
'http://\u2603.net/p\xe5th?q=\xe8ry%DF'
:param uri: The URI to convert.
:param charset: The encoding to encode unquoted bytes with.
:param errors: Error handler to use during ``bytes.encode``. By
default, invalid bytes are left quoted.
.. versionchanged:: 0.15
All reserved and invalid characters remain quoted. Previously,
only some reserved characters were preserved, and invalid bytes
were replaced instead of left quoted.
.. versionadded:: 0.6
) r,<00>tuplerAr>r rSr!<00>_to_iri_unsafer"r#rrF)<06>urirxryr!r"r#rrrrI<00>s
rIz:/?#[]@!$&'()*+,;=%Fc Cs<>t|t<01>rt|<00>}|rVy*t|<00>}|<04>d<01>}t|<05><06><00>dkr>|SWntk
rTYnXtt |||<02><03>}t
|j ||t <0C>}t
|j ||t <0C>}t
|j||t <0C>}tt|j|<00><10>|||f<05><01>S)aConvert an IRI to a URI. All non-ASCII and unsafe characters are
quoted. If the URL has a domain, it is encoded to Punycode.
>>> iri_to_uri('http://\u2603.net/p\xe5th?q=\xe8ry%DF')
'http://xn--n3h.net/p%C3%A5th?q=%C3%A8ry%DF'
:param iri: The IRI to convert.
:param charset: The encoding of the IRI.
:param errors: Error handler to use during ``bytes.encode``.
:param safe_conversion: Return the URL unchanged if it only contains
ASCII characters and no whitespace. See the explanation below.
There is a general problem with IRI conversion with some protocols
that are in violation of the URI specification. Consider the
following two IRIs::
magnet:?xt=uri:whatever
itms-services://?action=download-manifest
After parsing, we don't know if the scheme requires the ``//``,
which is dropped if empty, but conveys different meanings in the
final URL if it's present or not. In this case, you can use
``safe_conversion``, which will return the URL unchanged if it only
contains ASCII characters and no whitespace. This can result in a
URI with unquoted characters if it was not already quoted correctly,
but preserves the URL's semantics. Werkzeug uses this for the
``Location`` header for redirects.
.. versionchanged:: 0.15
All reserved characters remain unquoted. Previously, only some
reserved characters were left unquoted.
.. versionchanged:: 0.9.6
The ``safe_conversion`` parameter was added.
.. versionadded:: 0.6
rr)r,r<>rAr
rr[rZr-r>r rtr!<00> _to_uri_safer"r#rru) ZirirxryZsafe_conversionZ
native_iriZ ascii_irir!r"r#rrrrG<00>s &

rG<00>&cCsx|dkrddlm}|}t|t<03>r<t|t<03>s<|<05>|p6d<04>}n"t|t<05>r^t|t<05>s^|<05>|pZd<04>}|t|<00>|<05>||||<04><05>S)a<>
Parse a querystring and return it as :class:`MultiDict`. There is a
difference in key decoding on different Python versions. On Python 3
keys will always be fully decoded whereas on Python 2, keys will
remain bytestrings if they fit into ASCII. On 2.x keys can be forced
to be unicode by setting `decode_keys` to `True`.
If the charset is set to `None` no unicode decoding will happen and
raw bytes will be returned.
Per default a missing value for a key will default to an empty key. If
you don't want that behavior you can set `include_empty` to `False`.
Per default encoding errors are ignored. If you want a different behavior
you can set `errors` to ``'replace'`` or ``'strict'``. In strict mode a
`HTTPUnicodeError` is raised.
.. versionchanged:: 0.5
In previous versions ";" and "&" could be used for url decoding.
This changed in 0.5 where only "&" is supported. If you want to
use ";" instead a different `separator` can be provided.
The `cls` parameter was added.
:param s: a string with the query string to decode.
:param charset: the charset of the query string. If set to `None`
no unicode decoding will take place.
:param decode_keys: Used on Python 2.x to control whether keys should
be forced to be unicode objects. If set to `True`
then keys will be unicode in all cases. Otherwise,
they remain `str` if they fit into ASCII.
:param include_empty: Set to `False` if you don't want empty values to
appear in the dict.
:param errors: the decoding error behavior.
:param separator: the pair separator to be used, defaults to ``&``
:param cls: an optional dict class to use. If this is not specified
or `None` the default :class:`MultiDict` is used.
Nr)<01> MultiDictr) r<>r<>r,r r~r<>r<00>_url_decode_implrZ)r<>rx<00> decode_keys<79> include_emptyry<00> separator<6F>clsr<73>rrrr; s/ r;c CsPddlm} | |||<07>}
t|
||||<04>} |r0| S|dkrHddlm} | }|| <0B>S)a<>Works like :func:`url_decode` but decodes a stream. The behavior
of stream and limit follows functions like
:func:`~werkzeug.wsgi.make_line_iter`. The generator of pairs is
directly fed to the `cls` so you can consume the data while it's
parsed.
.. versionadded:: 0.8
:param stream: a stream with the encoded querystring
:param charset: the charset of the query string. If set to `None`
no unicode decoding will take place.
:param decode_keys: Used on Python 2.x to control whether keys should
be forced to be unicode objects. If set to `True`,
keys will be unicode in all cases. Otherwise, they
remain `str` if they fit into ASCII.
:param include_empty: Set to `False` if you don't want empty values to
appear in the dict.
:param errors: the decoding error behavior.
:param separator: the pair separator to be used, defaults to ``&``
:param cls: an optional dict class to use. If this is not specified
or `None` the default :class:`MultiDict` is used.
:param limit: the content length of the URL data. Not necessary if
a limited stream is provided.
:param return_iterator: if set to `True` the `cls` argument is ignored
and an iterator over all decoded pairs is
returned
r)<01>make_chunk_iterN)r<>)Zwsgir<69>r<>r<>r<>) <0A>streamrxr<>r<>ryr<>r<><00>limitZreturn_iteratorr<72><00> pair_iter<65>decoderr<72>rrr<00>url_decode_streamJs&   r<>c
cs<>x<>|D]|}|sqt|<05>}|d<01>}||kr:|<05>|d<02>\}} n|s@q|}|d<03>} t|||<04>}|dk rptrp|spt|<08>}|t| ||<04>fVqWdS)Nr<4E>rrC)rrZr<>rr )
r<EFBFBD>rxr<>r<>ry<00>pairr<72><00>equalr<6C>r<>rrrr<><00>s
 r<><00>&cCs t|d<01>}|<05>t|||||<04><05>S)a<>URL encode a dict/`MultiDict`. If a value is `None` it will not appear
in the result string. Per default only values are encoded into the target
charset strings. If `encode_keys` is set to ``True`` unicode keys are
supported too.
If `sort` is set to `True` the items are sorted by `key` or the default
sorting algorithm.
.. versionadded:: 0.5
`sort`, `key`, and `separator` were added.
:param obj: the object to encode into a query string.
:param charset: the charset of the query string.
:param encode_keys: set to `True` if you have unicode keys. (Ignored on
Python 3.x)
:param sort: set to `True` if you want parameters to be sorted by `key`.
:param separator: the separator to be used for the pairs.
:param key: an optional function to be used for sorting. For more details
check out the :func:`sorted` documentation.
r)r
r@r<>)r<>rxr<>r<>r<>r<>rrr<00>
url_encode<EFBFBD>s
r<>c
CsXt|d<01>}t|||||<05>}|dkr&|Sx,t|<07>D] \}} |rF|<01>|<06>|<01>| <09>q0WdS)a<>Like :meth:`url_encode` but writes the results to a stream
object. If the stream is `None` a generator over all encoded
pairs is returned.
.. versionadded:: 0.8
:param obj: the object to encode into a query string.
:param stream: a stream to write the encoded object into or `None` if
an iterator over the encoded pairs should be returned. In
that case the separator argument is ignored.
:param charset: the charset of the query string.
:param encode_keys: set to `True` if you have unicode keys. (Ignored on
Python 3.x)
:param sort: set to `True` if you want parameters to be sorted by `key`.
:param separator: the separator to be used for the pairs.
:param key: an optional function to be used for sorting. For more details
check out the :func:`sorted` documentation.
rN)r
r<><00> enumerate<74>write)
r<EFBFBD>r<>rxr<>r<>r<>r<><00>genrf<00>chunkrrr<00>url_encode_stream<61>s

r<>cs<>t|t<01>rt|<00>}t|t<01>r$t|<01>}t||f<02>\}}t|<00><01>|sD|S|sL|St||d<01>\}}}}}t|||<02>\}} }
} } ||kr<>|S| r<>t|| |
| | f<05>S|} |
dd<03><00>d<04>kr<>|
<EFBFBD><06>d<04><01>} n@|
s<EFBFBD>|<05><06>d<04><01>} | s<>|} n$|<05><06>d<04><01>dd<05>|
<EFBFBD><06>d<04><01>} | d<00>d<06>k<02>r <20>d<07>| d<<00>fdd <09>| D<00>} xvd}t| <0A>d}x^||k<00>r<>| |<00>d
<EFBFBD>k<02>r<>| |d<00>d<07><01>d
<EFBFBD>fk<07>r<>| |d|d<00>=P|d7}<0E>qFWP<00>q4W<00>d<07><01>d
<EFBFBD>g}x| dd <0B>|k<02>r<>| d=<00>q<>W<00>d<04><01>| <0A>}
t|| |
| | f<05>S) a Join a base URL and a possibly relative URL to form an absolute
interpretation of the latter.
:param base: the base URL for the join operation.
:param url: the URL to join.
:param allow_fragments: indicates whether fragments should be allowed.
)r<>NrrN<00><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.rCcsg|]}|<01>d<00>kr|<01>qS)r<>r)r<00>segment)r<>rrrszurl_join.<locals>.<listcomp>z..rO) r,r<>rArrr>rZr[r@)<11>baser<65>r<><00>bscheme<6D>bnetloc<6F>bpath<74>bquery<72> bfragmentrr r!r"r#<00>segmentsr<73><00>nZunwanted_markerr)r<>rr?<00>sT

$   0 r?c@s*eZdZdZd dd<07>Zdd <09>Zd
d <0B>ZdS) <0A>Hrefa<66>Implements a callable that constructs URLs with the given base. The
function can be called with any number of positional and keyword
arguments which than are used to assemble the URL. Works with URLs
and posix paths.
Positional arguments are appended as individual segments to
the path of the URL:
>>> href = Href('/foo')
>>> href('bar', 23)
'/foo/bar/23'
>>> href('foo', bar=23)
'/foo/foo?bar=23'
If any of the arguments (positional or keyword) evaluates to `None` it
will be skipped. If no keyword arguments are given the last argument
can be a :class:`dict` or :class:`MultiDict` (or any other dict subclass),
otherwise the keyword arguments are used for the query parameters, cutting
off the first trailing underscore of the parameter name:
>>> href(is_=42)
'/foo?is=42'
>>> href({'foo': 'bar'})
'/foo?foo=bar'
Combining of both methods is not allowed:
>>> href({'foo': 'bar'}, bar=42)
Traceback (most recent call last):
...
TypeError: keyword arguments and query-dicts can't be combined
Accessing attributes on the href object creates a new href object with
the attribute name as prefix:
>>> bar_href = href.bar
>>> bar_href("blub")
'/foo/bar/blub'
If `sort` is set to `True` the items are sorted by `key` or the default
sorting algorithm:
>>> href = Href("/", sort=True)
>>> href(a=1, b=2, c=3)
'/?a=1&b=2&c=3'
.. versionadded:: 0.5
`sort` and `key` were added.
<20>./<2F>utf-8FNcCs$|sd}||_||_||_||_dS)Nz./)r<>rxr<>r<>)r&r<>rxr<>r<>rrr<00>__init__Is z Href.__init__cCsP|dd<01>dkrt|<01><01>|j}|dd<00>dkr6|d7}tt||<01>|j|j|j<06>S)NrO<00>__r<5F>rN)<07>AttributeErrorr<72>r<>r?rxr<>r<>)r&rUr<>rrr<00> __getattr__Qs zHref.__getattr__c s<>|r6t|dt<01>r6|rtd<02><01>|d|dd<01>}}n|rPtdd<04>|<02><03>D<00><01>}d<05><04>fdd<04>|D<00><01><01>d<05>}<01>j}|r<>|<03>d<05>s<>|d7}t|d|<00>}|r<>|dt t
|<02>j <0B>j <0C>j d <09>d
<EFBFBD>7}t|<03>S) Nr<4E>z3keyword arguments and query-dicts can't be combinedcSs.g|]&\}}|<01>d<00>r"|dd<02>p$||f<02>qS)<03>_Nr<4E>)<01>endswith)r<00>k<>vrrrr`sz!Href.__call__.<locals>.<listcomp>rNcs&g|]}|dk rtt|<01>j<02>d<01><02>qS)Nr)r rtrx)r<00>x)r&rrrdsz./r<>)r<>r<>r)r,<00>dictr1r<>r@rYr<>rr?r r<>rxr<>r<>r
)r&r!r"r.r)r&r<00>__call__Ys(


z Href.__call__)r<>r<>FN)rhrirjrkr<>r<>rrrrrr<>s1
r<>)rC)rC)NT)r<>rsr<>rC)r<>rsr<>rC)r<>rsrC)r<>r(rC)r<>r()r<>)r<>r<>)r<>rsF)r<>FTr(r<>N)r<>FTr(r<>NNF)r<>FFNr<4E>)Nr<4E>FFNr<4E>)T)?rk<00>codecsrT<00>re<72> collectionsr<00>_compatrrrrrr r
r r <00> _internalr r<00>compiler<65>r<>r<>r<>rrr<>r<>r<>rr$rnrwr<>r<>r<>r6r>r<>r<>r<>r<>rtr<>rArSr<>r<>r@r<>r<><00>register_errorrIr<>rGr;r<>r<>r<>r<>r?r<>r<>rrrr<00><module>s<>            
s 1



1
! 




 

A
9
-


C