HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/pip/_vendor/platformdirs/__pycache__/windows.cpython-37.pyc
B

L��ge%�@s�dZddlmZddlZddlZddlZddlmZddlm	Z	ddl
mZe	r\ddlm
Z
Gd	d
�d
e�Zddd�d
d�Zddd�dd�Zddd�dd�Zddd�dd�Zdd�dd�Zedd�e��Zd
gZdS)zWindows.�)�annotationsN)�	lru_cache)�
TYPE_CHECKING�)�PlatformDirsABC)�Callablec@s$eZdZdZedd�dd��Zdd�dddd	�d
d�Zedd�dd
��Zedd�dd��Zedd�dd��Z	edd�dd��Z
edd�dd��Zedd�dd��Zedd�dd��Z
edd�dd��Zedd�dd��Zedd�dd��Zedd�d d!��Zedd�d"d#��Zedd�d$d%��ZdS)&�Windowsa
    `MSDN on where to store app data files
    <http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH3194121123120121120120>`_.
    Makes use of the
    `appname <platformdirs.api.PlatformDirsABC.appname>`,
    `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`,
    `version <platformdirs.api.PlatformDirsABC.version>`,
    `roaming <platformdirs.api.PlatformDirsABC.roaming>`,
    `opinion <platformdirs.api.PlatformDirsABC.opinion>`,
    `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.
    �str)�returncCs(|jr
dnd}tj�t|��}|�|�S)z�
        :return: data directory tied to the user, e.g.
         ``%USERPROFILE%\AppData\Local\$appauthor\$appname`` (not roaming) or
         ``%USERPROFILE%\AppData\Roaming\$appauthor\$appname`` (roaming)
        �
CSIDL_APPDATA�CSIDL_LOCAL_APPDATA)�roaming�os�path�normpath�get_win_folder�
_append_parts)�self�constr�r�D/tmp/pip-unpacked-wheel-hv55ucu3/pip/_vendor/platformdirs/windows.py�
user_data_dirszWindows.user_data_dirN)�
opinion_valuez
str | None)rrr
cCs�g}|jr`|jdk	r*|jp|j}|�|�|�|j�|dk	rN|jrN|�|�|jr`|�|j�tjj|f|��}|�|�|S)NF)	�appname�	appauthor�append�opinion�versionrr�join�_optionally_create_directory)rrr�params�authorrrrr(s



zWindows._append_partscCstj�td��}|�|�S)zT:return: data directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname``�CSIDL_COMMON_APPDATA)rrrrr)rrrrr�
site_data_dir7szWindows.site_data_dircCs|jS)zC:return: config directory tied to the user, same as `user_data_dir`)r)rrrr�user_config_dir=szWindows.user_config_dircCs|jS)zF:return: config directory shared by the users, same as `site_data_dir`)r#)rrrr�site_config_dirBszWindows.site_config_dircCstj�td��}|j|dd�S)z�
        :return: cache directory tied to the user (if opinionated with ``Cache`` folder within ``$appname``) e.g.
         ``%USERPROFILE%\AppData\Local\$appauthor\$appname\Cache\$version``
        r�Cache)r)rrrrr)rrrrr�user_cache_dirGszWindows.user_cache_dircCstj�td��}|j|dd�S)zd:return: cache directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname\Cache\$version``r"r&)r)rrrrr)rrrrr�site_cache_dirPszWindows.site_cache_dircCs|jS)zB:return: state directory tied to the user, same as `user_data_dir`)r)rrrr�user_state_dirVszWindows.user_state_dircCs(|j}|jr$tj�|d�}|�|�|S)zg:return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``Logs`` in it�Logs)rrrrrr)rrrrr�user_log_dir[s

zWindows.user_log_dircCstj�td��S)zN:return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents``�CSIDL_PERSONAL)rrrr)rrrr�user_documents_dirdszWindows.user_documents_dircCstj�td��S)zN:return: downloads directory tied to the user e.g. ``%USERPROFILE%\Downloads``�CSIDL_DOWNLOADS)rrrr)rrrr�user_downloads_diriszWindows.user_downloads_dircCstj�td��S)zL:return: pictures directory tied to the user e.g. ``%USERPROFILE%\Pictures``�CSIDL_MYPICTURES)rrrr)rrrr�user_pictures_dirnszWindows.user_pictures_dircCstj�td��S)zH:return: videos directory tied to the user e.g. ``%USERPROFILE%\Videos``�
CSIDL_MYVIDEO)rrrr)rrrr�user_videos_dirsszWindows.user_videos_dircCstj�td��S)zF:return: music directory tied to the user e.g. ``%USERPROFILE%\Music``�
CSIDL_MYMUSIC)rrrr)rrrr�user_music_dirxszWindows.user_music_dircCs$tj�tj�td�d��}|�|�S)z�
        :return: runtime directory tied to the user, e.g.
         ``%USERPROFILE%\AppData\Local\Temp\$appauthor\$appname``
        rZTemp)rrrrrr)rrrrr�user_runtime_dir}szWindows.user_runtime_dir)�__name__�
__module__�__qualname__�__doc__�propertyrrr#r$r%r'r(r)r+r-r/r1r3r5r6rrrrrs 		rr	)�
csidl_namer
cCsjt|�}|dk	r|Sdddd��|�}|dkr@d|��}t|��tj�|�}|dkrfd|��}t|��|S)z&Get folder from environment variables.N�APPDATAZALLUSERSPROFILE�LOCALAPPDATA)rr"rzUnknown CSIDL name: zUnset environment variable: )�(get_win_folder_if_csidl_name_not_env_var�get�
ValueErrorr�environ)r<�resultZenv_var_name�msgrrr�get_win_folder_from_env_vars�s

rEz
str | NonecCs�|dkr$tj�tj�tjd�d�S|dkrHtj�tj�tjd�d�S|dkrltj�tj�tjd�d�S|dkr�tj�tj�tjd�d	�S|d
kr�tj�tj�tjd�d�SdS)
zKGet folder for a CSIDL name that does not exist as an environment variable.r,�USERPROFILEZ	Documentsr.�	Downloadsr0ZPicturesr2ZVideosr4ZMusicN)rrrrrB)r<rrrr?�sr?c	Csrddddddddd	��|�}|d
kr6d|��}t|��tjdkrDt�d
d
l}|�|jd�}|�||�\}}t	|�S)z�
    Get folder from the registry.

    This is a fallback technique at best. I'm not sure if using the registry for these guarantees us the correct answer
    for all CSIDL_* names.
    �AppDatazCommon AppDataz
Local AppDataZPersonalz&{374DE290-123F-4565-9164-39C4925E467B}zMy PictureszMy VideozMy Music)rr"rr,r.r0r2r4NzUnknown CSIDL name: �win32rz@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)
r@rA�sys�platform�NotImplementedError�winreg�OpenKey�HKEY_CURRENT_USER�QueryValueExr	)r<�shell_folder_namerDrM�key�	directory�_rrr�get_win_folder_from_registry�s$

rUc	Cs�ddddddddd	��|�}|d
kr6d|��}t|��t�d�}ttd
�}|j�d
|d
d|�tdd�|D��r�t�d�}|j�	|j
|d�r�|}|dkr�tj�
|j
d�S|j
S)zGet folder with ctypes.��#���'��
�()rr"rr,r0r2r4r.NzUnknown CSIDL name: i�windllrcss|]}t|�dkVqdS)�N)�ord)�.0�crrr�	<genexpr>�sz,get_win_folder_via_ctypes.<locals>.<genexpr>r.rG)r@rA�ctypes�create_unicode_buffer�getattr�shell32�SHGetFolderPathW�any�kernel32�GetShortPathNameW�valuerrr)r<�csidl_constrD�bufr^�buf2rrr�get_win_folder_via_ctypes�s,



rpzCallable[[str], str])r
cCs8ttd�rtSyddl}Wntk
r.tSXtSdS)Nr^r)�hasattrrdrprM�ImportErrorrErU)rMrrr�_pick_get_win_folder�s
rs)�maxsize)r:�
__future__rrdrrJ�	functoolsr�typingr�apir�collections.abcrrrEr?rUrprsr�__all__rrrr�<module>s"w$