![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /lib/python2.7/site-packages/requests_toolbelt/downloadutils/ |
� ӵ Yc @ s� d Z d d l Z d d l Z d d l Z d d l m Z d Z e j d e e f � Z d Z d � Z d � Z d e d � Z d S( s- Utilities for dealing with streamed requests.i����Ni ( t exceptionss "[^"\\]*(?:\\.[^"\\]*)*"s* ;\s*(%s|[^\s;=]+)\s*(?:=\s*(%s|[^;]+))?\s*i c C sP xI t j | � D]8 } | j � \ } } | d k r t j j | � d Sq Wd S( Nt filenamei ( t _OPTION_HEADER_PIECE_REt finditert groupst ost patht splitt None( t content_dispositiont matcht kt v( ( sJ /usr/lib/python2.7/site-packages/requests_toolbelt/downloadutils/stream.pyt _get_filename s c C s� | o t j j | � } | r. | r. | } nW t | j j d d � � } | sa t j d � � n | r t j j | | � } n | } | S( s� Given a response and a path, return a file path for a download. If a ``path`` parameter is a directory, this function will parse the ``Content-Disposition`` header on the response to determine the name of the file as reported by the server, and return a file path in the specified directory. If ``path`` is empty or None, this function will return a path relative to the process' current working directory. If path is a full file path, return it. :param response: A Response object from requests :type response: requests.models.Response :param str path: Directory or file path. :returns: full file path to download as :rtype: str :raises: :class:`requests_toolbelt.exceptions.StreamingError` s content-dispositiont s'