U e"@shdZddlmZddlZddlmZmZddlmZddl m Z e rTddl m Z m Z Gdd d eZ dS) z Base API.) annotationsN)ABCabstractmethod)Path) TYPE_CHECKING)IteratorLiteralc @s>eZdZdZdgddddddddd d d Zd d d ddZd ddddZeed dddZ eed dddZ eed dddZ eed dddZ eed dddZ eed dddZeed dd d!Zeed dd"d#Zeed dd$d%Zeed dd&d'Zeed dd(d)Zeed dd*d+Zeed dd,d-Zeed dd.d/Zeed dd0d1Zeed dd2d3Zed4dd5d6Zed4dd7d8Zed4dd9d:Zed4dd;d<Zed4dd=d>Zed4dd?d@Zed4ddAdBZed4ddCdDZ ed4ddEdFZ!ed4ddGdHZ"ed4ddIdJZ#ed4ddKdLZ$ed4ddMdNZ%ed4ddOdPZ&ed4ddQdRZ'ed4ddSdTZ(dUddVdWZ)dUddXdYZ*dUddZd[Z+dUdd\d]Z,d^dd_d`Z-d^ddadbZ.d^ddcddZ/d^ddedfZ0dS)hPlatformDirsABCz-Abstract base class for platform directories.NFTz str | Nonezstr | None | Literal[False]boolNone)appname appauthorversionroaming multipathopinion ensure_existsreturncCs.||_||_||_||_||_||_||_dS)aX 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 rrrrr)selfr r rrrrrr>/opt/hc_python/lib/python3.8/site-packages/platformdirs/api.py__init__szPlatformDirsABC.__init__str)basercGsXt|dd}|jr4||j|jr4||jtjj|df|}|||S)Nr)listr appendrospathjoin_optionally_create_directory)rrparamsrrrr_append_app_name_and_versionCs   z,PlatformDirsABC._append_app_name_and_version)rrcCs|jrt|jddddS)NT)parentsexist_ok)rrmkdirrrrrrr Msz,PlatformDirsABC._optionally_create_directory)rcCsdS)z(:return: data directory tied to the userNrrrrr user_data_dirQszPlatformDirsABC.user_data_dircCsdS)z':return: data directory shared by usersNrr'rrr site_data_dirVszPlatformDirsABC.site_data_dircCsdS)z*:return: config directory tied to the userNrr'rrruser_config_dir[szPlatformDirsABC.user_config_dircCsdS)z-:return: config directory shared by the usersNrr'rrrsite_config_dir`szPlatformDirsABC.site_config_dircCsdS)z):return: cache directory tied to the userNrr'rrruser_cache_direszPlatformDirsABC.user_cache_dircCsdS)z(:return: cache directory shared by usersNrr'rrrsite_cache_dirjszPlatformDirsABC.site_cache_dircCsdS)z):return: state directory tied to the userNrr'rrruser_state_diroszPlatformDirsABC.user_state_dircCsdS)z':return: log directory tied to the userNrr'rrr user_log_dirtszPlatformDirsABC.user_log_dircCsdS)z-:return: documents directory tied to the userNrr'rrruser_documents_dirysz"PlatformDirsABC.user_documents_dircCsdS)z-:return: downloads directory tied to the userNrr'rrruser_downloads_dir~sz"PlatformDirsABC.user_downloads_dircCsdS)z,:return: pictures directory tied to the userNrr'rrruser_pictures_dirsz!PlatformDirsABC.user_pictures_dircCsdS)z*:return: videos directory tied to the userNrr'rrruser_videos_dirszPlatformDirsABC.user_videos_dircCsdS)z):return: music directory tied to the userNrr'rrruser_music_dirszPlatformDirsABC.user_music_dircCsdS)z+:return: desktop directory tied to the userNrr'rrruser_desktop_dirsz PlatformDirsABC.user_desktop_dircCsdS)z+:return: runtime directory tied to the userNrr'rrruser_runtime_dirsz PlatformDirsABC.user_runtime_dircCsdS)z*:return: runtime directory shared by usersNrr'rrrsite_runtime_dirsz PlatformDirsABC.site_runtime_dirrcCs t|jS)z#:return: data path tied to the user)rr(r'rrruser_data_pathszPlatformDirsABC.user_data_pathcCs t|jS)z":return: data path shared by users)rr)r'rrrsite_data_pathszPlatformDirsABC.site_data_pathcCs t|jS)z%:return: config path tied to the user)rr*r'rrruser_config_pathsz PlatformDirsABC.user_config_pathcCs t|jS)z(:return: config path shared by the users)rr+r'rrrsite_config_pathsz PlatformDirsABC.site_config_pathcCs t|jS)z$:return: cache path tied to the user)rr,r'rrruser_cache_pathszPlatformDirsABC.user_cache_pathcCs t|jS)z#:return: cache path shared by users)rr-r'rrrsite_cache_pathszPlatformDirsABC.site_cache_pathcCs t|jS)z$:return: state path tied to the user)rr.r'rrruser_state_pathszPlatformDirsABC.user_state_pathcCs t|jS)z":return: log path tied to the user)rr/r'rrr user_log_pathszPlatformDirsABC.user_log_pathcCs t|jS)z(:return: documents path tied to the user)rr0r'rrruser_documents_pathsz#PlatformDirsABC.user_documents_pathcCs t|jS)z(:return: downloads path tied to the user)rr1r'rrruser_downloads_pathsz#PlatformDirsABC.user_downloads_pathcCs t|jS)z':return: pictures path tied to the user)rr2r'rrruser_pictures_pathsz"PlatformDirsABC.user_pictures_pathcCs t|jS)z%:return: videos path tied to the user)rr3r'rrruser_videos_pathsz PlatformDirsABC.user_videos_pathcCs t|jS)z$:return: music path tied to the user)rr4r'rrruser_music_pathszPlatformDirsABC.user_music_pathcCs t|jS)z&:return: desktop path tied to the user)rr5r'rrruser_desktop_pathsz!PlatformDirsABC.user_desktop_pathcCs t|jS)z&:return: runtime path tied to the user)rr6r'rrruser_runtime_pathsz!PlatformDirsABC.user_runtime_pathcCs t|jS)z%:return: runtime path shared by users)rr7r'rrrsite_runtime_pathsz!PlatformDirsABC.site_runtime_pathz Iterator[str]ccs|jV|jVdS)z4:yield: all user and site configuration directories.N)r*r+r'rrriter_config_dirssz PlatformDirsABC.iter_config_dirsccs|jV|jVdS)z+:yield: all user and site data directories.N)r(r)r'rrriter_data_dirsszPlatformDirsABC.iter_data_dirsccs|jV|jVdS)z,:yield: all user and site cache directories.N)r,r-r'rrriter_cache_dirsszPlatformDirsABC.iter_cache_dirsccs|jV|jVdS)z.:yield: all user and site runtime directories.N)r6r7r'rrriter_runtime_dirssz!PlatformDirsABC.iter_runtime_dirszIterator[Path]ccs|D]}t|VqdS)z.:yield: all user and site configuration paths.N)rHrr&rrriter_config_pathss z!PlatformDirsABC.iter_config_pathsccs|D]}t|VqdS)z%:yield: all user and site data paths.N)rIrr&rrriter_data_paths s zPlatformDirsABC.iter_data_pathsccs|D]}t|VqdS)z&:yield: all user and site cache paths.N)rJrr&rrriter_cache_pathss z PlatformDirsABC.iter_cache_pathsccs|D]}t|VqdS)z(:yield: all user and site runtime paths.N)rKrr&rrriter_runtime_pathss z"PlatformDirsABC.iter_runtime_paths)NNNFFTF)1__name__ __module__ __qualname____doc__rr"r propertyrr(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrrrrr s2 r )rS __future__rrabcrrpathlibrtypingrrrr rrrrs