Current File : //usr/lib/python3/dist-packages/pip/_vendor/cachecontrol/__pycache__/controller.cpython-312.pyc |
�
/�g�G � � � d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl m
Z
mZmZ ddl
mZ ddlmZmZ ddlmZ e
rdd l mZ dd
lmZ ddlmZ ddlmZ ej4 e� Z ej: d
� ZdZdd�Z G d� d� Z!y)z7
The httplib2 algorithms ported for use with requests.
� )�annotationsN)�parsedate_tz)�
TYPE_CHECKING�
Collection�Mapping)�CaseInsensitiveDict)� DictCache�SeparateBodyBaseCache)�
Serializer)�Literal)�PreparedRequest)�HTTPResponse)� BaseCachez9^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?)�- �4 c � � t j | � }|�J �|j � }|d |d |d |d |d fS )z�Parses a URI using the regex given in Appendix B of RFC 3986.
(scheme, authority, path, query, fragment) = parse_uri(uri)
� � � � � )�URI�match�groups)�urir r s �E/usr/lib/python3/dist-packages/pip/_vendor/cachecontrol/controller.py� parse_urir % sM � �
�I�I�c�N�E�����
�\�\�^�F��1�I�v�a�y�&��)�V�A�Y��q� �B�B� c �� � e Zd ZdZ d
dd�Zedd�� Zedd�� Zdd�Zdd�Z dd�Z
dd �Z d dd
�Z d dd�Z
dd�Zy)�CacheControllerz4An interface to see if request should cached or not.Nc �t � |�
t � n|| _ || _ |xs
t � | _ |xs d| _ y )N)�� �� i, r r )r �cache�cache_etagsr �
serializer�cacheable_status_codes)�selfr$ r% r&