U
    M»{j$  ã                   @  sh   d Z ddlmZ ddlZddlmZmZ ddlmZ ddl	m
Z
 e
rTddl	mZmZ G dd	„ d	eƒZdS )
z	Base API.é    )ÚannotationsN)ÚABCÚabstractmethod)ÚPath)ÚTYPE_CHECKING)ÚIteratorÚLiteralc                
   @  sN  e Zd ZdZdjddddddddd	œd
d„Zdddœdd„Zdddœdd„Zdddœdd„Zee	ddœdd„ƒƒZ
ee	ddœdd„ƒƒZee	ddœdd„ƒƒZee	ddœdd„ƒƒZee	ddœd d!„ƒƒZee	ddœd"d#„ƒƒZee	ddœd$d%„ƒƒZee	ddœd&d'„ƒƒZee	ddœd(d)„ƒƒZee	ddœd*d+„ƒƒZee	ddœd,d-„ƒƒZee	ddœd.d/„ƒƒZee	ddœd0d1„ƒƒZee	ddœd2d3„ƒƒZee	ddœd4d5„ƒƒZee	ddœd6d7„ƒƒZeddœd8d9„ƒZeddœd:d;„ƒZeddœd<d=„ƒZeddœd>d?„ƒZeddœd@dA„ƒZeddœdBdC„ƒZeddœdDdE„ƒZ eddœdFdG„ƒZ!eddœdHdI„ƒZ"eddœdJdK„ƒZ#eddœdLdM„ƒZ$eddœdNdO„ƒZ%eddœdPdQ„ƒZ&eddœdRdS„ƒZ'eddœdTdU„ƒZ(eddœdVdW„ƒZ)dXdœdYdZ„Z*dXdœd[d\„Z+dXdœd]d^„Z,dXdœd_d`„Z-dadœdbdc„Z.dadœddde„Z/dadœdfdg„Z0dadœdhdi„Z1dS )kÚPlatformDirsABCz-Abstract base class for platform directories.NFTz
str | Nonezstr | None | Literal[False]ÚboolÚNone)ÚappnameÚ	appauthorÚversionÚroamingÚ	multipathÚopinionÚensure_existsÚreturnc                 C  s.   || _ || _|| _|| _|| _|| _|| _dS )aY  
        Create a new platform directory.

        :param appname: See `appname`.
        :param appauthor: See `appauthor`.
        :param version: See `version`.
        :param roaming: See `roaming`.
        :param multipath: See `multipath`.
        :param opinion: See `opinion`.
        :param ensure_exists: See `ensure_exists`.

        N)r   r   r   r   r   r   r   )Úselfr   r   r   r   r   r   r   © r   úO/var/www/html/bwave/python/venv/lib/python3.8/site-packages/platformdirs/api.pyÚ__init__   s    	zPlatformDirsABC.__init__Ústr)Úbaser   c                 G  sX   t |dd … ƒ}| jr4| | j¡ | jr4| | j¡ tjj|d f|žŽ }|  |¡ |S )Né   r   )Úlistr   Úappendr   ÚosÚpathÚjoinÚ_optionally_create_directory)r   r   Úparamsr   r   r   r   Ú_append_app_name_and_versionP   s    
z,PlatformDirsABC._append_app_name_and_version)r   r   c                 C  s   | j rt|ƒjddd� d S )NT)ÚparentsÚexist_ok)r   r   Úmkdir©r   r   r   r   r   r    Z   s    z,PlatformDirsABC._optionally_create_directoryr   )Ú	directoryr   c                 C  s   | j r| tj¡d }t|ƒS )Nr   )r   Úsplitr   Úpathsepr   )r   r'   r   r   r   Ú _first_item_as_path_if_multipath^   s    z0PlatformDirsABC._first_item_as_path_if_multipath)r   c                 C  s   dS )z(:return: data directory tied to the userNr   ©r   r   r   r   Úuser_data_dird   s    zPlatformDirsABC.user_data_dirc                 C  s   dS )z':return: data directory shared by usersNr   r+   r   r   r   Úsite_data_diri   s    zPlatformDirsABC.site_data_dirc                 C  s   dS )z*:return: config directory tied to the userNr   r+   r   r   r   Úuser_config_dirn   s    zPlatformDirsABC.user_config_dirc                 C  s   dS )z-:return: config directory shared by the usersNr   r+   r   r   r   Úsite_config_dirs   s    zPlatformDirsABC.site_config_dirc                 C  s   dS )z):return: cache directory tied to the userNr   r+   r   r   r   Úuser_cache_dirx   s    zPlatformDirsABC.user_cache_dirc                 C  s   dS )z(:return: cache directory shared by usersNr   r+   r   r   r   Úsite_cache_dir}   s    zPlatformDirsABC.site_cache_dirc                 C  s   dS )z):return: state directory tied to the userNr   r+   r   r   r   Úuser_state_dir‚   s    zPlatformDirsABC.user_state_dirc                 C  s   dS )z':return: log directory tied to the userNr   r+   r   r   r   Úuser_log_dir‡   s    zPlatformDirsABC.user_log_dirc                 C  s   dS )z-:return: documents directory tied to the userNr   r+   r   r   r   Úuser_documents_dirŒ   s    z"PlatformDirsABC.user_documents_dirc                 C  s   dS )z-:return: downloads directory tied to the userNr   r+   r   r   r   Úuser_downloads_dir‘   s    z"PlatformDirsABC.user_downloads_dirc                 C  s   dS )z,:return: pictures directory tied to the userNr   r+   r   r   r   Úuser_pictures_dir–   s    z!PlatformDirsABC.user_pictures_dirc                 C  s   dS )z*:return: videos directory tied to the userNr   r+   r   r   r   Úuser_videos_dir›   s    zPlatformDirsABC.user_videos_dirc                 C  s   dS )z):return: music directory tied to the userNr   r+   r   r   r   Úuser_music_dir    s    zPlatformDirsABC.user_music_dirc                 C  s   dS )z+:return: desktop directory tied to the userNr   r+   r   r   r   Úuser_desktop_dir¥   s    z PlatformDirsABC.user_desktop_dirc                 C  s   dS )z+:return: runtime directory tied to the userNr   r+   r   r   r   Úuser_runtime_dirª   s    z PlatformDirsABC.user_runtime_dirc                 C  s   dS )z*:return: runtime directory shared by usersNr   r+   r   r   r   Úsite_runtime_dir¯   s    z PlatformDirsABC.site_runtime_dirc                 C  s
   t | jƒS )z#:return: data path tied to the user)r   r,   r+   r   r   r   Úuser_data_path´   s    zPlatformDirsABC.user_data_pathc                 C  s
   t | jƒS )z":return: data path shared by users)r   r-   r+   r   r   r   Úsite_data_path¹   s    zPlatformDirsABC.site_data_pathc                 C  s
   t | jƒS )z%:return: config path tied to the user)r   r.   r+   r   r   r   Úuser_config_path¾   s    z PlatformDirsABC.user_config_pathc                 C  s
   t | jƒS )z(:return: config path shared by the users)r   r/   r+   r   r   r   Úsite_config_pathÃ   s    z PlatformDirsABC.site_config_pathc                 C  s
   t | jƒS )z$:return: cache path tied to the user)r   r0   r+   r   r   r   Úuser_cache_pathÈ   s    zPlatformDirsABC.user_cache_pathc                 C  s
   t | jƒS )z#:return: cache path shared by users)r   r1   r+   r   r   r   Úsite_cache_pathÍ   s    zPlatformDirsABC.site_cache_pathc                 C  s
   t | jƒS )z$:return: state path tied to the user)r   r2   r+   r   r   r   Úuser_state_pathÒ   s    zPlatformDirsABC.user_state_pathc                 C  s
   t | jƒS )z":return: log path tied to the user)r   r3   r+   r   r   r   Úuser_log_path×   s    zPlatformDirsABC.user_log_pathc                 C  s
   t | jƒS )z*:return: documents a path tied to the user)r   r4   r+   r   r   r   Úuser_documents_pathÜ   s    z#PlatformDirsABC.user_documents_pathc                 C  s
   t | jƒS )z(:return: downloads path tied to the user)r   r5   r+   r   r   r   Úuser_downloads_pathá   s    z#PlatformDirsABC.user_downloads_pathc                 C  s
   t | jƒS )z':return: pictures path tied to the user)r   r6   r+   r   r   r   Úuser_pictures_pathæ   s    z"PlatformDirsABC.user_pictures_pathc                 C  s
   t | jƒS )z%:return: videos path tied to the user)r   r7   r+   r   r   r   Úuser_videos_pathë   s    z PlatformDirsABC.user_videos_pathc                 C  s
   t | jƒS )z$:return: music path tied to the user)r   r8   r+   r   r   r   Úuser_music_pathð   s    zPlatformDirsABC.user_music_pathc                 C  s
   t | jƒS )z&:return: desktop path tied to the user)r   r9   r+   r   r   r   Úuser_desktop_pathõ   s    z!PlatformDirsABC.user_desktop_pathc                 C  s
   t | jƒS )z&:return: runtime path tied to the user)r   r:   r+   r   r   r   Úuser_runtime_pathú   s    z!PlatformDirsABC.user_runtime_pathc                 C  s
   t | jƒS )z%:return: runtime path shared by users)r   r;   r+   r   r   r   Úsite_runtime_pathÿ   s    z!PlatformDirsABC.site_runtime_pathzIterator[str]c                 c  s   | j V  | jV  dS )z4:yield: all user and site configuration directories.N)r.   r/   r+   r   r   r   Úiter_config_dirs  s    z PlatformDirsABC.iter_config_dirsc                 c  s   | j V  | jV  dS )z+:yield: all user and site data directories.N)r,   r-   r+   r   r   r   Úiter_data_dirs	  s    zPlatformDirsABC.iter_data_dirsc                 c  s   | j V  | jV  dS )z,:yield: all user and site cache directories.N)r0   r1   r+   r   r   r   Úiter_cache_dirs  s    zPlatformDirsABC.iter_cache_dirsc                 c  s   | j V  | jV  dS )z.:yield: all user and site runtime directories.N)r:   r;   r+   r   r   r   Úiter_runtime_dirs  s    z!PlatformDirsABC.iter_runtime_dirszIterator[Path]c                 c  s   |   ¡ D ]}t|ƒV  qdS )z.:yield: all user and site configuration paths.N)rL   r   r&   r   r   r   Úiter_config_paths  s    z!PlatformDirsABC.iter_config_pathsc                 c  s   |   ¡ D ]}t|ƒV  qdS )z%:yield: all user and site data paths.N)rM   r   r&   r   r   r   Úiter_data_paths  s    zPlatformDirsABC.iter_data_pathsc                 c  s   |   ¡ D ]}t|ƒV  qdS )z&:yield: all user and site cache paths.N)rN   r   r&   r   r   r   Úiter_cache_paths"  s    z PlatformDirsABC.iter_cache_pathsc                 c  s   |   ¡ D ]}t|ƒV  qdS )z(:yield: all user and site runtime paths.N)rO   r   r&   r   r   r   Úiter_runtime_paths'  s    z"PlatformDirsABC.iter_runtime_paths)NNNFFTF)2Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r"   r    r*   Úpropertyr   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   r   r   r   r   r	      sÈ          ø?
r	   )rW   Ú
__future__r   r   Úabcr   r   Úpathlibr   Útypingr   r   r   r	   r   r   r   r   Ú<module>   s   