관리-도구
편집 파일: fields.pyc
� �Rec @@ s� d d l m Z d d l Z d d l Z d d l Z d d l m Z d d � Z d � Z i d d 6d d 6d d 6Z e j d � e d d � D� � d � Z d � Z e Z d e f d � � YZ d S( i ( t absolute_importNi ( t sixs application/octet-streamc C@ s! | r t j | � d p | 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( t filenamet default( ( 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 guess_content_type s c @ s� t � t j � r$ � j d � � n t � f d � d D� � s� d | � f } y | j d � Wn t t f k rz q� X| Sn t j r� � j d � � n t j j � d � � d | � f � t j r� � j d � � n � S( 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. s utf-8c 3@ s | ] } | � k Vq d S( N( ( t .0t ch( t 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.pys <genexpr>) s s "\ u %s="%s"t asciis %s*=%s( t isinstanceR t binary_typet decodet anyt encodet UnicodeEncodeErrort UnicodeDecodeErrort PY2t emailt utilst encode_rfc2231( t nameR t result( ( 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.pyt format_header_param_rfc2231 s u %22u "u \\u \c C@ s7 i | ]- } | d k r d j | � t j | � � q S( i u %{:02X}( i ( t formatR t unichr( R t cc( ( 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>J s i c @ s_ � f d � } t j d j g � j � D] } t j | � ^ q( � � } | j | | � } | S( Nc @ s � | j d � S( Ni ( t group( t match( t needles_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.pyt replacerR s t |( t ret compilet joint keyst escapet sub( R R R t needlet patternR ( ( 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.pyt _replace_multipleQ s 4c C@ sA t | t j � r$ | j d � } n t | t � } d | | f S( 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. s utf-8u %s="%s"( R R R R R) t _HTML5_REPLACEMENTS( R 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.pyt format_header_param_html5^ s t RequestFieldc B@ s_ e Z d Z d d e d � Z e e d � � Z d � Z d � Z d � Z d d d d � Z RS( 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`. c C@ sI | | _ | | _ | | _ i | _ | r<