a
    hbòfc  ã                   @   sx   d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 dd„ Zd	d
„ Zdd„ Zddd„Zedkrteƒ  dS )é    N)Úrequests)ÚCacheControlAdapter)Ú	DictCache)Úlogger)ÚArgumentParserc                  C   s"   t  tj¡ t ¡ } t  | ¡ d S )N)r   ÚsetLevelÚloggingÚDEBUGÚStreamHandlerÚ
addHandler)Úhandler© r   úZ/home/httpd/docs/test/DocsMgr/lib/python3.9/site-packages/pip/_vendor/cachecontrol/_cmd.pyÚsetup_logging   s    r   c                  C   s>   t tƒ dd d d�} t ¡ }| d| ¡ | d| ¡ | j|_|S )NT)Úcache_etagsÚ
serializerÚ	heuristiczhttp://zhttps://)r   r   r   ÚSessionÚmountÚ
controllerÚcache_controller)ÚadapterÚsessr   r   r   Úget_session   s    
ÿr   c                  C   s   t ƒ } | jddd� |  ¡ S )NÚurlzThe URL to try and cache)Úhelp)r   Úadd_argumentÚ
parse_args)Úparserr   r   r   Úget_args"   s    r   c                 C   sT   t ƒ } tƒ }| | j¡}tƒ  |j |j|j¡ |j 	|j¡rHt
dƒ nt
dƒ d S )NzCached!zNot cached :()r   r   Úgetr   r   r   Úcache_responseÚrequestÚrawÚcached_requestÚprint)Úargsr   Úrespr   r   r   Úmain(   s    
r(   Ú__main__)N)r   Úpip._vendorr   Z pip._vendor.cachecontrol.adapterr   Zpip._vendor.cachecontrol.cacher   Z#pip._vendor.cachecontrol.controllerr   Úargparser   r   r   r   r(   Ú__name__r   r   r   r   Ú<module>   s   
