o
    üN iV  ã                   @   s²   U d dl Z d dl mZ d dlmZ d dlmZmZ d dlmZ ee	ef Z
ee  de ¡ d d ¡ƒae
ed	< 	 d
e	de	dee	e	f fdd„Zde
ddfdd„Zdefdd„ZdS )é    N)ÚPathLike)ÚPath)ÚTupleÚUnion)ÚurlparseÚCACHED_PATH_CACHE_ROOTz.cacheÚcached_pathÚCACHE_DIRECTORYÚurlÚproviderÚreturnc                 C   sN   t | ƒ}|jr
|jstd || ¡ƒ‚|j}|j}| d¡r#|dd… }||fS )z3Split a full s3 path into the bucket name and path.zbad {} path {}ú/é   N)r   ÚnetlocÚpathÚ
ValueErrorÚformatÚ
startswith)r
   r   ÚparsedÚbucket_nameÚprovider_path© r   úF/home/ubuntu/.local/lib/python3.10/site-packages/cached_path/common.pyÚ_split_cloud_path   s   
r   Ú	cache_dirc                 C   s   t | ƒadS )z1
    Set the global default cache directory.
    N©r   r	   )r   r   r   r   Úset_cache_dir   s   r   c                   C   s   t tƒS )z1
    Get the global default cache directory.
    r   r   r   r   r   Úget_cache_dir&   s   r   )Úosr   Úpathlibr   Útypingr   r   Úurllib.parser   ÚstrÚ	PathOrStrÚgetenvÚhomer	   Ú__annotations__r   r   r   r   r   r   r   Ú<module>   s   
 ÿ