https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/platformdirs/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/platformdirs/__pycache__/windows.cpython-310.pyc
o

�1b'�@s�ddlmZddlZddlZddlmZddlmZddlm	Z	Gdd�de	�Z
ddd
�Zddd�Zddd�Z
ddd�Zedd�e��ZdgZdS)�)�annotationsN)�	lru_cache)�Callable�)�PlatformDirsABCc@s�eZdZdZeddd��Zdd�ddd�Zedd
d��Zeddd��Zeddd��Z	eddd��Z
eddd��Zeddd��Zeddd��Z
eddd��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>`.�return�strcCs(|jrdnd}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�6/usr/lib/python3/dist-packages/platformdirs/windows.py�
user_data_dirs
zWindows.user_data_dirN��
opinion_valuerr�
str | NonecCstg}|jr0|jdur|jp|j}|�|�|�|j�|dur'|jr'|�|�|jr0|�|j�tjj|g|�R�S)NF)�appname�	appauthor�append�opinion�versionr
r�join)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�r
rrrr�rrrrr�
site_data_dir-s
zWindows.site_data_dircC�|jS)zC:return: config directory tied to the user, same as `user_data_dir`�r�rrrr�user_config_dir3�zWindows.user_config_dircCr&)zF:return: config directory shared by the users, same as `site_data_dir`)r%r(rrr�site_config_dir8r*zWindows.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�Cacherr#r$rrr�user_cache_dir=szWindows.user_cache_dircCr&)zB:return: state directory tied to the user, same as `user_data_dir`r'r(rrr�user_state_dirFr*zWindows.user_state_dircCs|j}|jr
tj�|d�}|S)zy
        :return: log directory tied to the user, same as `user_data_dir` if not opinionated else ``Logs`` in it
        �Logs)rrr
rrr$rrr�user_log_dirKszWindows.user_log_dircCstj�td��S)z`
        :return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents``
        �CSIDL_PERSONAL)r
rrrr(rrr�user_documents_dirUszWindows.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�Temp)r
rrrrrr$rrr�user_runtime_dir\s
zWindows.user_runtime_dir)rr	)rr	rrrr	)�__name__�
__module__�__qualname__�__doc__�propertyrrr%r)r+r-r.r0r2r4rrrrrs*	

	r�
csidl_namer	rcCsr|dkrtj�tj�tjd�d�Sdddd��|�}|dur&td	|����tj�|�}|dur7td
|����|S)z&Get folder from environment variables.r1�USERPROFILE�	Documents�APPDATA�ALLUSERSPROFILE�LOCALAPPDATA)r
r"rN�Unknown CSIDL name: zUnset environment variable: )r
rrr�environ�get�
ValueError)r:�env_var_name�resultrrr�get_win_folder_from_env_varsfs��rFcCsXddddd��|�}|durtd|����ddl}|�|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.
    �AppDatazCommon AppDataz
Local AppData�Personal�r
r"rr1Nr@rz@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)rBrC�winreg�OpenKey�HKEY_CURRENT_USER�QueryValueExr	)r:�shell_folder_namerJ�key�	directory�_rrr�get_win_folder_from_registryxs��rRcCs�ddddd��|�}|durtd|����t�d�}ttd	�}|j�d|dd
|�tdd�|D��rBt�d�}|j�	|j
|d�rB|}|j
S)
zGet folder with ctypes.��#��rINr@i�windllrcss�|]	}t|�dkVqdS)�N)�ord)�.0�crrr�	<genexpr>�s�z,get_win_folder_via_ctypes.<locals>.<genexpr>)rBrC�ctypes�create_unicode_buffer�getattr�shell32�SHGetFolderPathW�any�kernel32�GetShortPathNameW�value)r:�csidl_const�bufrW�buf2rrr�get_win_folder_via_ctypes�s"��


ri�Callable[[str], str]cCs4ttd�rtSzddl}WtStytYSw)NrWr)�hasattrr]rirJ�ImportErrorrFrR)rJrrr�_pick_get_win_folder�s

��rm)�maxsize)r:r	rr	)rrj)�
__future__rr]r
�	functoolsr�typingr�apirrrFrRrirmr�__all__rrrr�<module>s
[


�

https://t.me/RX1948 - 2025