Files
wg-backend-django/acer-env/lib/python3.10/site-packages/urllib3/__pycache__/fields.cpython-310.pyc

163 lines
8.0 KiB
Plaintext
Raw Normal View History

2022-11-30 15:58:16 +07:00
o
<00>Ԅc<D484>!<00>@s<>ddlmZddlZddlZddlZddlmZddd<07>Zdd <09>Z d
d d <0C>Z
e
<EFBFBD> d d<0E>e dd<0F>D<00><01>dd<11>Z dd<13>ZeZGdd<15>de<10>ZdS)<17>)<01>absolute_importN<74>)<01>six<69>application/octet-streamcCs|r t<00>|<00>dp
|S|S)z<>
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Content-Type" can be guessed, default to `default`.
r)<02> mimetypes<65>
guess_type)<02>filename<6D>default<6C>r
<00>a/home/infidel/Sync/Project/ocp-wg-backend/acer-env/lib/python3.10/site-packages/urllib3/fields.py<70>guess_content_type
s r c s<>t<00>tj<02>r <0B><00>d<01><01>t<04>fdd<03>dD<00><01>s0d|<00>f}z|<02>d<06>W|Sttfy/Ynwtjr8<72><00>d<01><01>t j
<EFBFBD> <0B>d<01><02>d|<00>f<00>tjrM<72><00>d<01><01><00>S)a!
Helper function to format and quote a single header parameter using the
strategy defined in RFC 2231.
Particularly useful for header parameters which might contain
non-ASCII values, like file names. This follows
`RFC 2388 Section 4.4 <https://tools.ietf.org/html/rfc2388#section-4.4>`_.
:param name:
The name of the parameter, a string expected to be ASCII only.
:param value:
The value of the parameter, provided as ``bytes`` or `str``.
:ret:
An RFC-2231-formatted unicode string.
<20>utf-8c3s<00>|]}|<01>vVqdS<00>Nr
)<02>.0<EFBFBD>ch<63><01>valuer
r <00> <genexpr>+s<02>z.format_header_param_rfc2231.<locals>.<genexpr>z"\
<EFBFBD>%s="%s"<22>asciiz%s*=%s) <0C>
isinstancer<00> binary_type<70>decode<64>any<6E>encode<64>UnicodeEncodeError<6F>UnicodeDecodeError<6F>PY2<59>email<69>utils<6C>encode_rfc2231)<03>namer<00>resultr
rr <00>format_header_param_rfc2231s" 
  <10><02>
 
r#z%22z\\)<02>"<22>\cCs&i|]}|dvrt<00>|<01>d<01>|<01><01>qS))<01>z%{:02X})r<00>unichr<68>format)r<00>ccr
r
r <00>
<dictcomp>Js <02><06>r*<00> cs:<00>fdd<02>}t<00>d<03>dd<05><00><00><03>D<00><01><01>}|<03>||<00>}|S)Ncs<00>|<00>d<01>S)Nr)<01>group)<01>match<63><01>needles_and_replacementsr
r <00>replacerSsz#_replace_multiple.<locals>.replacer<65>|cSsg|]}t<00>|<01><01>qSr
)<02>re<72>escape)r<00>needler
r
r <00>
<listcomp>Wsz%_replace_multiple.<locals>.<listcomp>)r2<00>compile<6C>join<69>keys<79>sub)rr/r0<00>patternr"r
r.r <00>_replace_multipleRs <04> r;cCs,t|tj<02>r |<01>d<01>}t|t<05>}d||fS)a<>
Helper function to format and quote a single header parameter using the
HTML5 strategy.
Particularly useful for header parameters which might contain
non-ASCII values, like file names. This follows the `HTML5 Working Draft
Section 4.10.22.7`_ and matches the behavior of curl and modern browsers.
.. _HTML5 Working Draft Section 4.10.22.7:
https://w3c.github.io/html/sec-forms.html#multipart-form-data
:param name:
The name of the parameter, a string expected to be ASCII only.
:param value:
The value of the parameter, provided as ``bytes`` or `str``.
:ret:
A unicode string, stripped of troublesome characters.
r r)rrrrr;<00>_HTML5_REPLACEMENTS)r!rr
r
r <00>format_header_param_html5_s 

 r=c@sTeZdZdZddefdd<04>Zeefdd<06><01>Zdd<08>Zd d
<EFBFBD>Z d d <0C>Z
dd d<0E>Z dS)<10> RequestFielda
A data container for request body parameters.
:param name:
The name of this request field. Must be unicode.
:param data:
The data/value body.
:param filename:
An optional filename of the request field. Must be unicode.
:param headers:
An optional dict-like object of headers to initially use for the field.
:param header_formatter:
An optional callable that is used to encode and format the headers. By
default, this is :func:`format_header_param_html5`.
NcCs0||_||_||_i|_|rt|<04>|_||_dSr)<06>_name<6D> _filename<6D>data<74>headers<72>dict<63>header_formatter)<06>selfr!rArrBrDr
r
r <00>__init__<5F>s

zRequestField.__init__cCs`t|t<01>rt|<02>dkr|\}}}n|\}}t|<04>}nd}d}|}|||||d<03>}|j|d<04>|S)a<>
A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters.
Supports constructing :class:`~urllib3.fields.RequestField` from
parameter of key/value strings AND key/filetuple. A filetuple is a
(filename, data, MIME type) tuple where the MIME type is optional.
For example::
'foo': 'bar',
'fakefile': ('foofile.txt', 'contents of foofile'),
'realfile': ('barfile.txt', open('realfile').read()),
'typedfile': ('bazfile.bin', open('bazfile').read(), 'image/jpeg'),
'nonamefile': 'contents of nonamefile field',
Field names and filenames must be unicode.
<20>N)rrD)<01> content_type)r<00>tuple<6C>lenr <00>make_multipart)<08>cls<6C> fieldnamerrDrrArH<00> request_paramr
r
r <00> from_tuples<65>s
  
<06> zRequestField.from_tuplescCs |<00>||<02>S)aI
Overridable helper function to format a single header parameter. By
default, this calls ``self.header_formatter``.
:param name:
The name of the parameter, a string expected to be ASCII only.
:param value:
The value of the parameter, provided as a unicode string.
)rD)rEr!rr
r
r <00> _render_part<72>s zRequestField._render_partcCsLg}|}t|t<01>r |<01><02>}|D]\}}|dur |<02>|<00>||<05><02>qd<02>|<02>S)aO
Helper function to format and quote a single header.
Useful for single headers that are composed of multiple items. E.g.,
'Content-Disposition' fields.
:param header_parts:
A sequence of (k, v) tuples or a :class:`dict` of (k, v) to format
as `k1="v1"; k2="v2"; ...`.
N<>; )rrC<00>items<6D>appendrPr7)rE<00> header_parts<74>parts<74>iterabler!rr
r
r <00> _render_parts<74>s 
 <02>
zRequestField._render_partscCs<>g}gd<01>}|D]}|j<00>|d<02>r|<01>d||j|f<00>q|j<00><03>D]\}}||vr6|r6|<01>d||f<00>q#|<01>d<04>d<04>|<01>S)z=
Renders the headers for this request field.
)<03>Content-Disposition<6F> Content-Type<70>Content-LocationFz%s: %sz
)rB<00>getrSrRr7)rE<00>lines<65> sort_keys<79>sort_key<65> header_name<6D> header_valuer
r
r <00>render_headers<72>s<02><02>

zRequestField.render_headersc CsX|pd|jd<|jdd<03>d|<00>d|jfd|jff<02>g<02>7<||jd<||jd<d S)
a|
Makes this request field into a multipart request field.
This method overrides "Content-Disposition", "Content-Type" and
"Content-Location" headers to the request parameter.
:param content_type:
The 'Content-Type' of the request body.
:param content_location:
The 'Content-Location' of the request body.
z form-datarXrQ<00>r!rrYrZN)rBr7rWr?r@)rE<00>content_dispositionrH<00>content_locationr
r
r rK<00>s<02><02><08>
zRequestField.make_multipart)NNN) <0C>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__r=rF<00> classmethodrOrPrWrarKr
r
r
r r>~s
<EFBFBD># <0E>r>)r)<12>
__future__r<00> email.utilsrrr2<00>packagesrr r#r<<00>update<74>ranger;r=<00>format_header_param<61>objectr>r
r
r
r <00><module>s&  
+<06><04><04>