File "fields.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pyc
File size: 10.25 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


Rec@@sddlmZddlZddlZddlZddlmZddZdZ	idd	6d
d6d
d6Z
e
jdeddDdZ
dZeZdefdYZdS(i(tabsolute_importNi(tsixsapplication/octet-streamcC@s!|rtj|dp|S|S(s
    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`.
    i(t	mimetypest
guess_type(tfilenametdefault((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pytguess_content_type	s	c@sttjr$jdntfddDsd|f}y|jdWnttfk
rzqX|Sntjrjdnt	j
jdd|ftjrjdnS(s
    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.

    :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.
    sutf-8c3@s|]}|kVqdS(N((t.0tch(tvalue(s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pys	<genexpr>)ss"\
u%s="%s"tasciis%s*=%s(t
isinstanceRtbinary_typetdecodetanytencodetUnicodeEncodeErrortUnicodeDecodeErrortPY2temailtutilstencode_rfc2231(tnameR	tresult((R	s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pytformat_header_param_rfc2231s 		u%22u"u\\u\cC@s7i|]-}|dkrdj|tj|qS(iu%{:02X}(i(tformatRtunichr(Rtcc((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pys
<dictcomp>Js	ic@s_fd}tjdjgjD]}tj|^q(}|j||}|S(Nc@s|jdS(Ni(tgroup(tmatch(tneedles_and_replacements(s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pytreplacerRst|(tretcompiletjointkeystescapetsub(R	RRtneedletpatternR((Rs/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pyt_replace_multipleQs
4cC@sAt|tjr$|jd}nt|t}d||fS(s
    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.
    sutf-8u%s="%s"(RRRR
R)t_HTML5_REPLACEMENTS(RR	((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pytformat_header_param_html5^stRequestFieldcB@s_eZdZddedZeedZdZdZ	dZ
ddddZRS(s
    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`.
    cC@sI||_||_||_i|_|r<t||_n||_dS(N(t_namet	_filenametdatatheaderstdicttheader_formatter(tselfRR/RR0R2((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pyt__init__s				cC@st|trNt|dkr3|\}}}q`|\}}t|}nd}d}|}|||d|d|}|jd||S(s
        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.
        iRR2tcontent_typeN(RttupletlenRtNonetmake_multipart(tclst	fieldnameR	R2RR/R5t
request_param((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pytfrom_tuplesscC@s|j||S(sI
        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.
        (R2(R3RR	((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pyt_render_partscC@svg}|}t|tr*|j}nx<|D]4\}}|dk	r1|j|j||q1q1Wdj|S(sO
        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"; ...`.
        u; N(RR1titemsR8tappendR>R#(R3theader_partstpartstiterableRR	((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pyt
_render_partss cC@sg}dddg}xD|D]<}|jj|tr|jd||j|fqqWxL|jjD];\}}||krl|r|jd||fqqlqlW|jddj|S(s=
        Renders the headers for this request field.
        sContent-DispositionsContent-TypesContent-Locationu%s: %su
(R0tgettFalseR@R?R#(R3tlinest	sort_keystsort_keytheader_nametheader_value((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pytrender_headerss
%!
c	C@st|p	d|jd<|jdcdjd|jd|jfd|jffg7<||jd<||jd<d	S(
s|
        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.

        u	form-datasContent-Dispositionu; uunameufilenamesContent-TypesContent-LocationN(R0R#RDR-R.(R3tcontent_dispositionR5tcontent_location((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pyR9s'
N(t__name__t
__module__t__doc__R8R+R4tclassmethodR=R>RDRLR9(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pyR,}s
#	
		i (t
__future__Rtemail.utilsRRR!tpackagesRRRR*tupdatetrangeR)R+tformat_header_paramtobjectR,(((s/builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/urllib3/fields.pyt<module>s"	)