HEX
Server: Apache
System: Linux br512.hostgator.com.br 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64
User: stiliz28 (2548)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/platformdirs/__pycache__/windows.cpython-39.pyc
a

y��d��@s�ddlmZddlZddlZddlZddlmZddlmZddl	m
Z
Gdd�de
�Zd	d	d
�dd�Zd	d	d
�d
d�Z
d	d	d
�dd�Zdd�dd�Zedd�e��ZdgZdS)�)�annotationsN)�	lru_cache)�Callable�)�PlatformDirsABCc@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��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>`.�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)Zroaming�os�path�normpath�get_win_folder�
_append_parts)�self�constr�r�8/usr/lib/python3.9/site-packages/platformdirs/windows.py�
user_data_dirszWindows.user_data_dirN��
opinion_valuez
str | None)rrr
cCstg}|jr`|jdur*|jp|j}|�|�|�|j�|durN|jrN|�|�|jr`|�|j�tjj|g|�R�S)NF)ZappnameZ	appauthor�append�opinion�versionr
r�join)rrr�paramsZauthorrrrr!s


zWindows._append_partscCstj�td��}|�|�S)zT:return: data directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname``�CSIDL_COMMON_APPDATA�r
rrrr�rrrrr�
site_data_dir.szWindows.site_data_dircCs|jS)zC:return: config directory tied to the user, same as `user_data_dir`�r�rrrr�user_config_dir4szWindows.user_config_dircCs|jS)zF:return: config directory shared by the users, same as `site_data_dir`)r!r#rrr�site_config_dir9szWindows.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ZCacherrr rrr�user_cache_dir>szWindows.user_cache_dircCs|jS)zB:return: state directory tied to the user, same as `user_data_dir`r"r#rrr�user_state_dirGszWindows.user_state_dircCs|j}|jrtj�|d�}|S)zy
        :return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``Logs`` in it
        ZLogs)rrr
rrr rrr�user_log_dirLszWindows.user_log_dircCstj�td��S)z`
        :return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents``
        �CSIDL_PERSONAL)r
rrrr#rrr�user_documents_dirVszWindows.user_documents_dircCs$tj�tj�td�d��}|�|�S)z�
        :return: runtime directory tied to the user, e.g.
         ``%USERPROFILE%\AppData\Local\Temp\$appauthor\$appname``
        rZTemp)r
rrrrrr rrr�user_runtime_dir]szWindows.user_runtime_dir)�__name__�
__module__�__qualname__�__doc__�propertyrrr!r$r%r&r'r(r*r+rrrrrs(	

	rr)�
csidl_namer
cCsr|dkr$tj�tj�tjd�d�Sdddd��|�}|durLtd	|����tj�|�}|durntd
|����|S)z&Get folder from environment variables.r)�USERPROFILEZ	Documents�APPDATAZALLUSERSPROFILEZLOCALAPPDATA)rrrN�Unknown CSIDL name: zUnset environment variable: )r
rrr�environ�get�
ValueError)r1Zenv_var_name�resultrrr�get_win_folder_from_env_varsgs��r9cCsfddddd��|�}|dur*td|����tjdkr8t�d	dl}|�|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 this guarantees us the correct answer for all CSIDL_*
    names.
    ZAppDatazCommon AppDataz
Local AppDataZPersonal�rrrr)Nr4�win32rz@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)
r6r7�sys�platform�NotImplementedError�winreg�OpenKey�HKEY_CURRENT_USERZQueryValueExr)r1Zshell_folder_namer?�keyZ	directory�_rrr�get_win_folder_from_registryys��
rDcCs�ddddd��|�}|dur*td|����t�d�}ttd	�}|j�d|dd
|�tdd�|D��r�t�d�}|j�	|j
|d�r�|}|j
S)
zGet folder with ctypes.��#��r:Nr4i�windllrcss|]}t|�dkVqdS)�N)�ord)�.0�crrr�	<genexpr>��z,get_win_folder_via_ctypes.<locals>.<genexpr>)r6r7�ctypesZcreate_unicode_buffer�getattrZshell32ZSHGetFolderPathW�anyZkernel32ZGetShortPathNameW�value)r1Zcsidl_const�bufrIZbuf2rrr�get_win_folder_via_ctypes�s"��


rUzCallable[[str], str]r	cCs:ttd�rtSzddl}Wnty0tYS0tSdS)NrIr)�hasattrrPrUr?�ImportErrorr9rD)r?rrr�_pick_get_win_folder�s

rX)�maxsize)Z
__future__rrPr
r<�	functoolsr�typingrZapirrr9rDrUrXr�__all__rrrr�<module>s[�