o aiE7 ã @ s„ d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m Z ddlmZ e e¡Ze d¡Zd d „ ZG dd„ deƒZdS ) z7 The httplib2 algorithms ported for use with requests. é N)Úparsedate_tz)ÚCaseInsensitiveDicté )Ú DictCache)Ú Serializerz9^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?c C s0 t | ¡ ¡ }|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) r é é é é )ÚURIÚmatchÚgroups)Úurir © r ú•/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/controller.pyÚ parse_uri s "r c @ s^ e Zd ZdZ ddd„Zedd„ ƒZedd „ ƒZd d„ Zdd „ Z dd„ Z ddd„Zdd„ ZdS )ÚCacheControllerz9An interface to see if request should cached or not. NTc C s4 |d u rt ƒ n|| _|| _|ptƒ | _|pd| _d S )N)éÈ éË i, é- )r ÚcacheÚcache_etagsr Ú serializerÚcacheable_status_codes)Úselfr r r Ústatus_codesr r r Ú__init__" s zCacheController.__init__c C sh t |ƒ\}}}}}|r |std| ƒ‚| ¡ }| ¡ }|sd}|r(d ||g¡p)|}|d | | }|S )z4Normalize the URL to create a safe key for the cachez(Only absolute URIs are allowed. uri = %sú/ú?z://)r Ú ExceptionÚlowerÚjoin) Úclsr ÚschemeÚ authorityÚpathÚqueryÚfragmentÚrequest_uriÚ defrag_urir r r Ú_urlnorm* s zCacheController._urlnormc C s | |¡S ©N)r* )r" r r r r Ú cache_url> s zCacheController.cache_urlc C s t dft dft dfddddddddt dfdœ}| d| dd¡¡}i }| d¡D ]c}| ¡ s/q(| d d ¡}|d ¡ }z|| \}} W n tyR t d|¡ Y q(w |rW| s[d ||<