o
    6‘ðiA$  ã                   @  sp   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
r.ddlmZ ddl	mZ G d	d
„ d
eƒZdS )z	Base API.é    )ÚannotationsN)ÚABCÚabstractmethod)ÚPath)ÚTYPE_CHECKING)ÚIterator)ÚLiteralc                   @  s˜  e Zd ZdZ							dpdqdd„Zdrdd„Zdsdd„Zdtdd„Zee	dudd„ƒƒZ
ee	dud d!„ƒƒZee	dud"d#„ƒƒZee	dud$d%„ƒƒZee	dud&d'„ƒƒZee	dud(d)„ƒƒZee	dud*d+„ƒƒZee	dud,d-„ƒƒZee	dud.d/„ƒƒZee	dud0d1„ƒƒZee	dud2d3„ƒƒZee	dud4d5„ƒƒZee	dud6d7„ƒƒZee	dud8d9„ƒƒZee	dud:d;„ƒƒZee	dud<d=„ƒƒZedvd>d?„ƒZedvd@dA„ƒZedvdBdC„ƒZedvdDdE„ƒZedvdFdG„ƒZedvdHdI„ƒZedvdJdK„ƒZ edvdLdM„ƒZ!edvdNdO„ƒZ"edvdPdQ„ƒZ#edvdRdS„ƒZ$edvdTdU„ƒZ%edvdVdW„ƒZ&edvdXdY„ƒZ'edvdZd[„ƒZ(edvd\d]„ƒZ)dwd_d`„Z*dwdadb„Z+dwdcdd„Z,dwdedf„Z-dxdhdi„Z.dxdjdk„Z/dxdldm„Z0dxdndo„Z1dS )yÚPlatformDirsABCz-Abstract base class for platform directories.NFTÚappnameú
str | NoneÚ	appauthorústr | Literal[False] | NoneÚversionÚroamingÚboolÚ	multipathÚopinionÚensure_existsÚreturnÚNonec                 C  s6   || _ || _	 || _	 || _	 || _	 || _|| _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   ú[/root/parts/websockify/install/lib/python3.10/site-packages/pip/_vendor/platformdirs/api.pyÚ__init__   s   zPlatformDirsABC.__init__ÚbaseÚstrc                 G  sZ   t |dd … ƒ}| jr| | j¡ | jr| | j¡ tjj|d g|¢R Ž }|  |¡ |S )Né   r   )Úlistr
   Úappendr   ÚosÚpathÚjoinÚ_optionally_create_directory)r   r   Úparamsr    r   r   r   Ú_append_app_name_and_versionQ   s   
z,PlatformDirsABC._append_app_name_and_versionr    c                 C  s    | j rt|ƒjddd� d S d S )NT)ÚparentsÚexist_ok)r   r   Úmkdir©r   r    r   r   r   r"   [   s   ÿz,PlatformDirsABC._optionally_create_directoryÚ	directoryr   c                 C  s   | j r| tj¡d }t|ƒS )Nr   )r   Ú	partitionr   Úpathsepr   )r   r)   r   r   r   Ú _first_item_as_path_if_multipath_   s   z0PlatformDirsABC._first_item_as_path_if_multipathc                 C  ó   dS )z(:return: data directory tied to the userNr   ©r   r   r   r   Úuser_data_dire   ó    zPlatformDirsABC.user_data_dirc                 C  r-   )z':return: data directory shared by usersNr   r.   r   r   r   Úsite_data_dirj   r0   zPlatformDirsABC.site_data_dirc                 C  r-   )z*:return: config directory tied to the userNr   r.   r   r   r   Úuser_config_diro   r0   zPlatformDirsABC.user_config_dirc                 C  r-   )z-:return: config directory shared by the usersNr   r.   r   r   r   Úsite_config_dirt   r0   zPlatformDirsABC.site_config_dirc                 C  r-   )z):return: cache directory tied to the userNr   r.   r   r   r   Úuser_cache_diry   r0   zPlatformDirsABC.user_cache_dirc                 C  r-   )z(:return: cache directory shared by usersNr   r.   r   r   r   Úsite_cache_dir~   r0   zPlatformDirsABC.site_cache_dirc                 C  r-   )z):return: state directory tied to the userNr   r.   r   r   r   Úuser_state_dirƒ   r0   zPlatformDirsABC.user_state_dirc                 C  r-   )z':return: log directory tied to the userNr   r.   r   r   r   Úuser_log_dirˆ   r0   zPlatformDirsABC.user_log_dirc                 C  r-   )z-:return: documents directory tied to the userNr   r.   r   r   r   Úuser_documents_dir�   r0   z"PlatformDirsABC.user_documents_dirc                 C  r-   )z-:return: downloads directory tied to the userNr   r.   r   r   r   Úuser_downloads_dir’   r0   z"PlatformDirsABC.user_downloads_dirc                 C  r-   )z,:return: pictures directory tied to the userNr   r.   r   r   r   Úuser_pictures_dir—   r0   z!PlatformDirsABC.user_pictures_dirc                 C  r-   )z*:return: videos directory tied to the userNr   r.   r   r   r   Úuser_videos_dirœ   r0   zPlatformDirsABC.user_videos_dirc                 C  r-   )z):return: music directory tied to the userNr   r.   r   r   r   Úuser_music_dir¡   r0   zPlatformDirsABC.user_music_dirc                 C  r-   )z+:return: desktop directory tied to the userNr   r.   r   r   r   Úuser_desktop_dir¦   r0   z PlatformDirsABC.user_desktop_dirc                 C  r-   )z+:return: runtime directory tied to the userNr   r.   r   r   r   Úuser_runtime_dir«   r0   z PlatformDirsABC.user_runtime_dirc                 C  r-   )z*:return: runtime directory shared by usersNr   r.   r   r   r   Úsite_runtime_dir°   r0   z PlatformDirsABC.site_runtime_dirc                 C  ó
   t | jƒS )z#:return: data path tied to the user)r   r/   r.   r   r   r   Úuser_data_pathµ   ó   
zPlatformDirsABC.user_data_pathc                 C  r@   )z":return: data path shared by users)r   r1   r.   r   r   r   Úsite_data_pathº   rB   zPlatformDirsABC.site_data_pathc                 C  r@   )z%:return: config path tied to the user)r   r2   r.   r   r   r   Úuser_config_path¿   rB   z PlatformDirsABC.user_config_pathc                 C  r@   )z(:return: config path shared by the users)r   r3   r.   r   r   r   Úsite_config_pathÄ   rB   z PlatformDirsABC.site_config_pathc                 C  r@   )z$:return: cache path tied to the user)r   r4   r.   r   r   r   Úuser_cache_pathÉ   rB   zPlatformDirsABC.user_cache_pathc                 C  r@   )z#:return: cache path shared by users)r   r5   r.   r   r   r   Úsite_cache_pathÎ   rB   zPlatformDirsABC.site_cache_pathc                 C  r@   )z$:return: state path tied to the user)r   r6   r.   r   r   r   Úuser_state_pathÓ   rB   zPlatformDirsABC.user_state_pathc                 C  r@   )z":return: log path tied to the user)r   r7   r.   r   r   r   Úuser_log_pathØ   rB   zPlatformDirsABC.user_log_pathc                 C  r@   )z*:return: documents a path tied to the user)r   r8   r.   r   r   r   Úuser_documents_pathÝ   rB   z#PlatformDirsABC.user_documents_pathc                 C  r@   )z(:return: downloads path tied to the user)r   r9   r.   r   r   r   Úuser_downloads_pathâ   rB   z#PlatformDirsABC.user_downloads_pathc                 C  r@   )z':return: pictures path tied to the user)r   r:   r.   r   r   r   Úuser_pictures_pathç   rB   z"PlatformDirsABC.user_pictures_pathc                 C  r@   )z%:return: videos path tied to the user)r   r;   r.   r   r   r   Úuser_videos_pathì   rB   z PlatformDirsABC.user_videos_pathc                 C  r@   )z$:return: music path tied to the user)r   r<   r.   r   r   r   Úuser_music_pathñ   rB   zPlatformDirsABC.user_music_pathc                 C  r@   )z&:return: desktop path tied to the user)r   r=   r.   r   r   r   Úuser_desktop_pathö   rB   z!PlatformDirsABC.user_desktop_pathc                 C  r@   )z&:return: runtime path tied to the user)r   r>   r.   r   r   r   Úuser_runtime_pathû   rB   z!PlatformDirsABC.user_runtime_pathc                 C  r@   )z%:return: runtime path shared by users)r   r?   r.   r   r   r   Úsite_runtime_path   rB   z!PlatformDirsABC.site_runtime_pathúIterator[str]c                 c  ó   � | j V  | jV  dS )z4:yield: all user and site configuration directories.N)r2   r3   r.   r   r   r   Úiter_config_dirs  ó   €z PlatformDirsABC.iter_config_dirsc                 c  rS   )z+:yield: all user and site data directories.N)r/   r1   r.   r   r   r   Úiter_data_dirs
  rU   zPlatformDirsABC.iter_data_dirsc                 c  rS   )z,:yield: all user and site cache directories.N)r4   r5   r.   r   r   r   Úiter_cache_dirs  rU   zPlatformDirsABC.iter_cache_dirsc                 c  rS   )z.:yield: all user and site runtime directories.N)r>   r?   r.   r   r   r   Úiter_runtime_dirs  rU   z!PlatformDirsABC.iter_runtime_dirsúIterator[Path]c                 c  ó   � |   ¡ D ]}t|ƒV  qdS )z.:yield: all user and site configuration paths.N)rT   r   r(   r   r   r   Úiter_config_paths  ó   €ÿz!PlatformDirsABC.iter_config_pathsc                 c  rZ   )z%:yield: all user and site data paths.N)rV   r   r(   r   r   r   Úiter_data_paths  r\   zPlatformDirsABC.iter_data_pathsc                 c  rZ   )z&:yield: all user and site cache paths.N)rW   r   r(   r   r   r   Úiter_cache_paths#  r\   z PlatformDirsABC.iter_cache_pathsc                 c  rZ   )z(:yield: all user and site runtime paths.N)rX   r   r(   r   r   r   Úiter_runtime_paths(  r\   z"PlatformDirsABC.iter_runtime_paths)NNNFFTF)r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   )r    r   r   r   )r)   r   r   r   )r   r   )r   r   )r   rR   )r   rY   )2Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r$   r"   r,   Úpropertyr   r/   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   rA   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rT   rV   rW   rX   r[   r]   r^   r_   r   r   r   r   r	      sÊ    ø
?









r	   )rc   Ú
__future__r   r   Úabcr   r   Úpathlibr   Útypingr   Úcollections.abcr   r   r	   r   r   r   r   Ú<module>   s    