Files
old-saburly-wagtail-web/env/lib/python3.10/site-packages/urllib3/__pycache__/fields.cpython-310.pyc

170 lines
9.5 KiB
Plaintext
Raw Normal View History

2024-08-27 20:33:44 +02:00
o
<00><><EFBFBD>f[*<00>@s<>ddlmZddlZddlZddlZejeefZ eje ej
ee fej
ee effZ ddd d
<EFBFBD>Z ddd<0F>Z ddd<11>Zddd<13>Zddd<15>ZGdd<17>d<17>ZdS)<1B>)<01> annotationsN<73>application/octet-stream<61>filename<6D>
str | None<6E>default<6C>str<74>returncCs|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)rr<00>r <00>P/home/amir/Desktop/saburlyweb/env/lib/python3.10/site-packages/urllib3/fields.py<70>guess_content_types r <00>name<6D>value<75>_TYPE_FIELD_VALUEc s<>ddl}|jdtdd<05>t<03>t<04>r<16><00>d<06><01>t<06>fdd<08>d D<00><01>s=|<00>d
<EFBFBD><00>d <0B>}z|<03>d <0C>W|Stt fy<Ynwt
j <0B> <0C>d<06><02>|<00>d <0A><00><00><03><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``.
:returns:
An RFC-2231-formatted unicode string.
.. deprecated:: 2.0.0
Will be removed in urllib3 v2.1.0. This is not valid for
``multipart/form-data`` header parameters.
rNz<4E>'format_header_param_rfc2231' is deprecated and will be removed in urllib3 v2.1.0. This is not valid for multipart/form-data header parameters.<2E><00><01>
stacklevel<EFBFBD>utf-8c3s<00>|]}|<01>vVqdS<00>Nr )<02>.0<EFBFBD>ch<63>rr r <00> <genexpr>@s<02>z.format_header_param_rfc2231.<locals>.<genexpr>z"\
<EFBFBD>="<22>"<22>asciiz*=) <0A>warnings<67>warn<72>DeprecationWarning<6E>
isinstance<EFBFBD>bytes<65>decode<64>any<6E>encode<64>UnicodeEncodeError<6F>UnicodeDecodeError<6F>email<69>utils<6C>encode_rfc2231)rrr<00>resultr rr <00>format_header_param_rfc2231s&<06>

 <10><02>r+cCs6t|t<01>r
|<01>d<01>}|<01>dddd<05><03>}|<00>d|<01>d<07>S)a<>
Format and quote a single multipart header parameter.
This follows the `WHATWG HTML Standard`_ as of 2021/06/10, matching
the behavior of current browser and curl versions. Values are
assumed to be UTF-8. The ``\n``, ``\r``, and ``"`` characters are
percent encoded.
.. _WHATWG HTML Standard:
https://html.spec.whatwg.org/multipage/
form-control-infrastructure.html#multipart-form-data
:param name:
The name of the parameter, an ASCII-only ``str``.
:param value:
The value of the parameter, a ``str`` or UTF-8 encoded
``bytes``.
:returns:
A string ``name="value"`` with the escaped value.
.. versionchanged:: 2.0.0
Matches the WHATWG HTML Standard as of 2021/06/10. Control
characters are no longer percent encoded.
.. versionchanged:: 2.0.0
Renamed from ``format_header_param_html5`` and
``format_header_param``. The old names will be removed in
urllib3 v2.1.0.
rz%0Az%0Dz%22)<03>
<00> <00>"rr)r r!r"<00> translate)rrr r r <00>format_multipart_header_paramOs

r0cC<01>"ddl}|jdtdd<05>t||<01>S)<06><>
.. deprecated:: 2.0.0
Renamed to :func:`format_multipart_header_param`. Will be
removed in urllib3 v2.1.0.
rNz<4E>'format_header_param_html5' has been renamed to 'format_multipart_header_param'. The old name will be removed in urllib3 v2.1.0.rr<00>rrrr0<00>rrrr r r <00>format_header_param_html5u<00><06>
r5cCr1)r2rNzz'format_header_param' has been renamed to 'format_multipart_header_param'. The old name will be removed in urllib3 v2.1.0.rrr3r4r r r <00>format_header_param<61>r6r7c@sdeZdZdZ   d#d$d d<0E>Ze d%d&dd<14><05>Zd'dd<16>Zd(dd<1A>Zd)dd<1C>Z   d#d*d!d"<22>Z
dS)+<2B> RequestFielda<64>
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.
.. versionchanged:: 2.0.0
The ``header_formatter`` parameter is deprecated and will
be removed in urllib3 v2.1.0.
Nrr<00>datarrr<00>headers<72>typing.Mapping[str, str] | None<6E>header_formatter<65>5typing.Callable[[str, _TYPE_FIELD_VALUE], str] | NonecCsZ||_||_||_i|_|rt|<04>|_|dur(ddl}|jdtdd<04>||_dSt |_dS)NrzUThe 'header_formatter' parameter is deprecated and will be removed in urllib3 v2.1.0.rr)
<EFBFBD>_name<6D> _filenamer9r:<00>dictrrrr<r0)<07>selfrr9rr:r<rr r r <00>__init__<5F>s
<06>

zRequestField.__init__<5F> fieldnamer<00>_TYPE_FIELD_VALUE_TUPLErcCs`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)rr<)<01> content_type)r <00>tuple<6C>lenr <00>make_multipart)<08>clsrCrr<rr9rF<00> request_paramr r r <00> from_tuples<65>s
  
<06> zRequestField.from_tuplescCs |<00>||<02>S)a<>
Override this method to change how each multipart header
parameter is formatted. By default, this calls
:func:`format_multipart_header_param`.
:param name:
The name of the parameter, an ASCII-only ``str``.
:param value:
The value of the parameter, a ``str`` or UTF-8 encoded
``bytes``.
:meta public:
)r<)rArrr r r <00> _render_part<72>s zRequestField._render_part<72> header_parts<74>[dict[str, _TYPE_FIELD_VALUE | None] | typing.Sequence[tuple[str, _TYPE_FIELD_VALUE | None]]cCsNg}t|t<01>r |<01><02>}n|}|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<>; )r r@<00>items<6D>appendrM<00>join)rArN<00>parts<74>iterablerrr r r <00> _render_partss

 <02>
zRequestField._render_partscCs<>g}gd<01>}|D]}|j<00>|d<02>r|<01>|<03>d|j|<00><00><03>q|j<00><03>D]\}}||vr8|r8|<01>|<04>d|<05><00><03>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: z
)r:<00>getrRrQrS)rA<00>lines<65> sort_keys<79>sort_key<65> header_name<6D> header_valuer r r <00>render_headers#s<02><02>

zRequestField.render_headers<72>content_dispositionrF<00>content_location<6F>Nonec CsN|pdd<02>d|<00>d|jfd|jff<02>g<02>}||jd<||jd<||jd<d S)
a<EFBFBD>
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_disposition:
The 'Content-Disposition' of the request body. Defaults to 'form-data'
:param content_type:
The 'Content-Type' of the request body.
:param content_location:
The 'Content-Location' of the request body.
z form-datarP<00>rrrWrXrYN)rSrVr>r?r:)rArarFrbr r r rI6s
<02><02><06>
zRequestField.make_multipart)NNN)
rrr9rrrr:r;r<r=r)rCrrrDr<r=rr8<00>rrrrrr)rNrOrr)rr)rarrFrrbrrrc) <0B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rB<00> classmethodrLrMrVr`rIr r r r r8<00>s  <0C><0E>
,

<10>r8)r)rrrrrrre)<12>
__future__r<00> email.utilsr'r <00>typing<6E>Unionrr!r<00>TuplerDr r+r0r5r7r8r r r r <00><module>s$  <02><04> <0C>

0
&