%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/platformdirs/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/platformdirs/__pycache__/windows.cpython-37.pyc

B

Ĥ�a'�@s�ddlmZddlZddlZddlmZddlmZddlm	Z	Gdd�de	�Z
d	d	d
�dd�Zd	d	d
�d
d�Zd	d	d
�dd�Z
dd�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�E/opt/alt/python37/lib/python3.7/site-packages/platformdirs/windows.py�
user_data_dirszWindows.user_data_dirN)�
opinion_valuez
str | None)r
rr	cCsrg}|jr`|jdk	r*|jp|j}|�|�|�|j�|dk	rN|jrN|�|�|jr`|�|j�tjj|f|��S)NF)ZappnameZ	appauthor�append�opinion�versionrr
�join)rr
rZparamsZauthorrrrr s


zWindows._append_partscCstj�td��}|�|�S)zT:return: data directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname``�CSIDL_COMMON_APPDATA)rr
rrr)rr
rrr�
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_dir3szWindows.user_config_dircCs|jS)zF:return: config directory shared by the users, same as `site_data_dir`)r)rrrr�site_config_dir8szWindows.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``
        rZCache)r)rr
rrr)rr
rrr�user_cache_dir=szWindows.user_cache_dircCs|jS)zB:return: state directory tied to the user, same as `user_data_dir`)r)rrrr�user_state_dirFszWindows.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r
r)rr
rrr�user_log_dirKszWindows.user_log_dircCstj�td��S)z`
        :return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents``
        �CSIDL_PERSONAL)rr
rr)rrrr�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``
        rZTemp)rr
rrrr)rr
rrr�user_runtime_dir\szWindows.user_runtime_dir)�__name__�
__module__�__qualname__�__doc__�propertyrrrrrrr r!r#r$rrrrrs
	
rr)�
csidl_namer	cCsr|dkr$tj�tj�tjd�d�Sdddd��|�}|dkrLtd	|����tj�|�}|dkrntd
|����|S)z&Get folder from environment variables.r"ZUSERPROFILEZ	Documents�APPDATAZALLUSERSPROFILEZLOCALAPPDATA)r
rrNzUnknown CSIDL name: zUnset environment variable: )rr
rr�environ�get�
ValueError)r*Zenv_var_name�resultrrr�get_win_folder_from_env_varsfsr0cCsXddddd��|�}|dkr*td|����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.
    ZAppDatazCommon AppDataz
Local AppDataZPersonal)r
rrr"NzUnknown CSIDL name: rz@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)r-r.�winreg�OpenKey�HKEY_CURRENT_USERZQueryValueExr)r*Zshell_folder_namer1�keyZ	directory�_rrr�get_win_folder_from_registryxsr6cCs�ddddd��|�}|dkr*td|����t�d�}ttd	�}|j�d|dd
|�tdd�|D��r�t�d�}|j�	|j
|d�r�|}|j
S)
zGet folder with ctypes.��#��)r
rrr"NzUnknown CSIDL name: i�windllrcss|]}t|�dkVqdS)�N)�ord)�.0�crrr�	<genexpr>�sz,get_win_folder_via_ctypes.<locals>.<genexpr>)r-r.�ctypesZcreate_unicode_buffer�getattrZshell32ZSHGetFolderPathW�anyZkernel32ZGetShortPathNameW�value)r*Zcsidl_constZbufr;Zbuf2rrr�get_win_folder_via_ctypes�s


rEzCallable[[str], str])r	cCs8ttd�rtSyddl}Wntk
r.tSXtSdS)Nr;r)�hasattrrArEr1�ImportErrorr0r6)r1rrr�_pick_get_win_folder�s
rH)�maxsize)Z
__future__rrAr�	functoolsr�typingrZapirrr0r6rErHr�__all__rrrr�<module>s[

Zerion Mini Shell 1.0