
    3i1                    v    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
e      Zy)z	Base API.    )annotationsN)ABCabstractmethod)Path)TYPE_CHECKING)Iterator)Literalc                     e Zd ZdZ	 	 	 	 	 	 	 	 d?	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d@dZdAdZdBdZdCdZee	dDd              Z
ee	dDd              Zee	dDd	              Zee	dDd
              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              Zee	dDd              ZedEd       Z edEd       Z!edEd       Z"edEd        Z#edEd!       Z$edEd"       Z%edEd#       Z&edEd$       Z'edEd%       Z(edEd&       Z)edEd'       Z*edEd(       Z+edEd)       Z,edEd*       Z-edEd+       Z.edEd,       Z/edEd-       Z0edEd.       Z1edEd/       Z2edEd0       Z3edEd1       Z4edEd2       Z5dFd3Z6dFd4Z7dFd5Z8dFd6Z9dFd7Z:dFd8Z;dGd9Z<dGd:Z=dGd;Z>dGd<Z?dGd=Z@dGd>ZAy)HPlatformDirsABCav  Abstract base class defining all platform directory properties, their :class:`~pathlib.Path` variants, and iterators.

    Platform-specific subclasses (e.g. :class:`~platformdirs.windows.Windows`, :class:`~platformdirs.macos.MacOS`,
    :class:`~platformdirs.unix.Unix`) implement the abstract properties to return the appropriate paths for each
    operating system.

    Nc	                    || _         || _        	 || _        	 || _        	 || _        	 || _        	 || _        	 || _        y)a  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`.
        :param use_site_for_root: See `use_site_for_root`.

        N)appname	appauthorversionroaming	multipathopinionensure_existsuse_site_for_root)	selfr   r   r   r   r   r   r   r   s	            C/var/www/opsc/venv/lib/python3.12/site-packages/platformdirs/api.py__init__zPlatformDirsABC.__init__   sm    . "	
 	 	 #	 	 +	
 "3	    c                &   t        |dd        }| j                  rB|j                  | j                         | j                  r|j                  | j                         t	        j
                  j                  |d   g| }| j                  |       |S )N   r   )listr   appendr   ospathjoin_optionally_create_directory)r   baseparamsr   s       r   _append_app_name_and_versionz,PlatformDirsABC._append_app_name_and_version`   sm    d12h<<MM$,,'||dll+ww||DG-f-))$/r   c                V    | j                   rt        |      j                  dd       y y )NT)parentsexist_ok)r   r   mkdirr   r   s     r   r    z,PlatformDirsABC._optionally_create_directoryj   s'    JTD9 r   c                t    | j                   r"|j                  t        j                        d   }t	        |      S )Nr   )r   	partitionr   pathsepr   )r   	directorys     r    _first_item_as_path_if_multipathz0PlatformDirsABC._first_item_as_path_if_multipathn   s,    >>!++BJJ7:IIr   c                     y)z):returns: data directory tied to the userN r   s    r   user_data_dirzPlatformDirsABC.user_data_dirt       r   c                     y)z(:returns: data directory shared by usersNr/   r0   s    r   site_data_dirzPlatformDirsABC.site_data_diry   r2   r   c                     y)z+:returns: config directory tied to the userNr/   r0   s    r   user_config_dirzPlatformDirsABC.user_config_dir~   r2   r   c                     y)z*:returns: config directory shared by usersNr/   r0   s    r   site_config_dirzPlatformDirsABC.site_config_dir   r2   r   c                     y)z*:returns: cache directory tied to the userNr/   r0   s    r   user_cache_dirzPlatformDirsABC.user_cache_dir   r2   r   c                     y)z):returns: cache directory shared by usersNr/   r0   s    r   site_cache_dirzPlatformDirsABC.site_cache_dir   r2   r   c                     y)z*:returns: state directory tied to the userNr/   r0   s    r   user_state_dirzPlatformDirsABC.user_state_dir   r2   r   c                     y)z):returns: state directory shared by usersNr/   r0   s    r   site_state_dirzPlatformDirsABC.site_state_dir   r2   r   c                     y)z(:returns: log directory tied to the userNr/   r0   s    r   user_log_dirzPlatformDirsABC.user_log_dir   r2   r   c                     y)z':returns: log directory shared by usersNr/   r0   s    r   site_log_dirzPlatformDirsABC.site_log_dir   r2   r   c                     y)z.:returns: documents directory tied to the userNr/   r0   s    r   user_documents_dirz"PlatformDirsABC.user_documents_dir   r2   r   c                     y)z.:returns: downloads directory tied to the userNr/   r0   s    r   user_downloads_dirz"PlatformDirsABC.user_downloads_dir   r2   r   c                     y)z-:returns: pictures directory tied to the userNr/   r0   s    r   user_pictures_dirz!PlatformDirsABC.user_pictures_dir   r2   r   c                     y)z+:returns: videos directory tied to the userNr/   r0   s    r   user_videos_dirzPlatformDirsABC.user_videos_dir   r2   r   c                     y)z*:returns: music directory tied to the userNr/   r0   s    r   user_music_dirzPlatformDirsABC.user_music_dir   r2   r   c                     y)z,:returns: desktop directory tied to the userNr/   r0   s    r   user_desktop_dirz PlatformDirsABC.user_desktop_dir   r2   r   c                     y)z(:returns: bin directory tied to the userNr/   r0   s    r   user_bin_dirzPlatformDirsABC.user_bin_dir   r2   r   c                     y)z':returns: bin directory shared by usersNr/   r0   s    r   site_bin_dirzPlatformDirsABC.site_bin_dir   r2   r   c                     y)z1:returns: applications directory tied to the userNr/   r0   s    r   user_applications_dirz%PlatformDirsABC.user_applications_dir   r2   r   c                     y)z0:returns: applications directory shared by usersNr/   r0   s    r   site_applications_dirz%PlatformDirsABC.site_applications_dir   r2   r   c                     y)z,:returns: runtime directory tied to the userNr/   r0   s    r   user_runtime_dirz PlatformDirsABC.user_runtime_dir   r2   r   c                     y)z+:returns: runtime directory shared by usersNr/   r0   s    r   site_runtime_dirz PlatformDirsABC.site_runtime_dir   r2   r   c                ,    t        | j                        S )z$:returns: data path tied to the user)r   r1   r0   s    r   user_data_pathzPlatformDirsABC.user_data_path        D&&''r   c                ,    t        | j                        S )z#:returns: data path shared by users)r   r4   r0   s    r   site_data_pathzPlatformDirsABC.site_data_path   r_   r   c                ,    t        | j                        S )z&:returns: config path tied to the user)r   r6   r0   s    r   user_config_pathz PlatformDirsABC.user_config_path        D(())r   c                ,    t        | j                        S )z%:returns: config path shared by users)r   r8   r0   s    r   site_config_pathz PlatformDirsABC.site_config_path   rd   r   c                ,    t        | j                        S )z%:returns: cache path tied to the user)r   r:   r0   s    r   user_cache_pathzPlatformDirsABC.user_cache_path        D''((r   c                ,    t        | j                        S )z$:returns: cache path shared by users)r   r<   r0   s    r   site_cache_pathzPlatformDirsABC.site_cache_path   ri   r   c                ,    t        | j                        S )z%:returns: state path tied to the user)r   r>   r0   s    r   user_state_pathzPlatformDirsABC.user_state_path   ri   r   c                ,    t        | j                        S )z$:returns: state path shared by users)r   r@   r0   s    r   site_state_pathzPlatformDirsABC.site_state_path  ri   r   c                ,    t        | j                        S )z#:returns: log path tied to the user)r   rB   r0   s    r   user_log_pathzPlatformDirsABC.user_log_path
       D%%&&r   c                ,    t        | j                        S )z":returns: log path shared by users)r   rD   r0   s    r   site_log_pathzPlatformDirsABC.site_log_path  rr   r   c                ,    t        | j                        S )z):returns: documents path tied to the user)r   rF   r0   s    r   user_documents_pathz#PlatformDirsABC.user_documents_path       D++,,r   c                ,    t        | j                        S )z):returns: downloads path tied to the user)r   rH   r0   s    r   user_downloads_pathz#PlatformDirsABC.user_downloads_path  rw   r   c                ,    t        | j                        S )z(:returns: pictures path tied to the user)r   rJ   r0   s    r   user_pictures_pathz"PlatformDirsABC.user_pictures_path  s     D**++r   c                ,    t        | j                        S )z&:returns: videos path tied to the user)r   rL   r0   s    r   user_videos_pathz PlatformDirsABC.user_videos_path#  rd   r   c                ,    t        | j                        S )z%:returns: music path tied to the user)r   rN   r0   s    r   user_music_pathzPlatformDirsABC.user_music_path(  ri   r   c                ,    t        | j                        S )z':returns: desktop path tied to the user)r   rP   r0   s    r   user_desktop_pathz!PlatformDirsABC.user_desktop_path-       D))**r   c                ,    t        | j                        S )z#:returns: bin path tied to the user)r   rR   r0   s    r   user_bin_pathzPlatformDirsABC.user_bin_path2  rr   r   c                ,    t        | j                        S )z":returns: bin path shared by users)r   rT   r0   s    r   site_bin_pathzPlatformDirsABC.site_bin_path7  rr   r   c                ,    t        | j                        S )z,:returns: applications path tied to the user)r   rV   r0   s    r   user_applications_pathz&PlatformDirsABC.user_applications_path<       D..//r   c                ,    t        | j                        S )z+:returns: applications path shared by users)r   rX   r0   s    r   site_applications_pathz&PlatformDirsABC.site_applications_pathA  r   r   c                ,    t        | j                        S )z':returns: runtime path tied to the user)r   rZ   r0   s    r   user_runtime_pathz!PlatformDirsABC.user_runtime_pathF  r   r   c                ,    t        | j                        S )z&:returns: runtime path shared by users)r   r\   r0   s    r   site_runtime_pathz!PlatformDirsABC.site_runtime_pathK  r   r   c              #  D   K   | j                    | j                   yw)z4:yield: all user and site configuration directories.N)r6   r8   r0   s    r   iter_config_dirsz PlatformDirsABC.iter_config_dirsP  s     """"""    c              #  D   K   | j                    | j                   yw)z+:yield: all user and site data directories.N)r1   r4   r0   s    r   iter_data_dirszPlatformDirsABC.iter_data_dirsU  s           r   c              #  D   K   | j                    | j                   yw)z,:yield: all user and site cache directories.N)r:   r<   r0   s    r   iter_cache_dirszPlatformDirsABC.iter_cache_dirsZ       !!!!!!r   c              #  D   K   | j                    | j                   yw)z,:yield: all user and site state directories.N)r>   r@   r0   s    r   iter_state_dirszPlatformDirsABC.iter_state_dirs_  r   r   c              #  D   K   | j                    | j                   yw)z*:yield: all user and site log directories.N)rB   rD   r0   s    r   iter_log_dirszPlatformDirsABC.iter_log_dirsd  s     r   c              #  D   K   | j                    | j                   yw)z.:yield: all user and site runtime directories.N)rZ   r\   r0   s    r   iter_runtime_dirsz!PlatformDirsABC.iter_runtime_dirsi  s     ######r   c              #  P   K   | j                         D ]  }t        |        yw)z.:yield: all user and site configuration paths.N)r   r   r(   s     r   iter_config_pathsz!PlatformDirsABC.iter_config_pathsn  s(     ))+ 	Dt*	   $&c              #  P   K   | j                         D ]  }t        |        yw)z%:yield: all user and site data paths.N)r   r   r(   s     r   iter_data_pathszPlatformDirsABC.iter_data_pathss  s(     '') 	Dt*	r   c              #  P   K   | j                         D ]  }t        |        yw)z&:yield: all user and site cache paths.N)r   r   r(   s     r   iter_cache_pathsz PlatformDirsABC.iter_cache_pathsx  (     ((* 	Dt*	r   c              #  P   K   | j                         D ]  }t        |        yw)z&:yield: all user and site state paths.N)r   r   r(   s     r   iter_state_pathsz PlatformDirsABC.iter_state_paths}  r   r   c              #  P   K   | j                         D ]  }t        |        yw)z$:yield: all user and site log paths.N)r   r   r(   s     r   iter_log_pathszPlatformDirsABC.iter_log_paths  s(     &&( 	Dt*	r   c              #  P   K   | j                         D ]  }t        |        yw)z(:yield: all user and site runtime paths.N)r   r   r(   s     r   iter_runtime_pathsz"PlatformDirsABC.iter_runtime_paths  s(     **, 	Dt*	r   )NNNFFTFF)r   
str | Noner   zstr | Literal[False] | Noner   r   r   boolr   r   r   r   r   r   r   r   returnNone)r!   strr   r   )r   r   r   r   )r,   r   r   r   )r   r   )r   r   )r   zIterator[str])r   zIterator[Path])B__name__
__module____qualname____doc__r   r#   r    r-   propertyr   r1   r4   r6   r8   r:   r<   r>   r@   rB   rD   rF   rH   rJ   rL   rN   rP   rR   rT   rV   rX   rZ   r\   r^   ra   rc   rf   rh   rk   rm   ro   rq   rt   rv   ry   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      s    #15"#"'FF /F 	F
 F F F F  F 
FP: 8  8 7  7 :  : 9  9 9  9 8  8 9  9 8  8 7  7 6  6 =  = =  = <  < :  : 9  9 ;  ; 7  7 6  6 @  @ ?  ? ;  ; :  : ( ( ( ( * * * * ) ) ) ) ) ) ) ) ' ' ' ' - - - - , , * * ) ) + + ' ' ' ' 0 0 0 0 + + + +#
!
"
"
 
$





r   r   )r   
__future__r   r   abcr   r   pathlibr   typingr   collections.abcr   r	   r   r/   r   r   <module>r      s.     " 	 #   ({c {r   