a
lj @ s d dl Z d dlZd dlmZ d dlmZmZ ddlmZ G dd deZ e
e
dd d
Ze
e
dddZe
e
dd
dZ
ee
ge
f dddZedde ZdgZdS ) N) lru_cache)CallableOptional )PlatformDirsABCc @ s e Zd ZdZeedddZddeee eddd Zeedd
dZ eeddd
Z
eedddZeedddZeedddZ
eedddZeedddZeedddZdS )Windowsa `MSDN on where to store app data files
`_.
Makes use of the
`appname `,
`appauthor `,
`version `,
`roaming `,
`opinion `.returnc C s( | j r
dnd}tjt|}| |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_APPDATACSIDL_LOCAL_APPDATA)Zroamingospathnormpathget_win_folder
_append_parts)selfconstr
r D/usr/lib/python3.9/site-packages/pip/_vendor/platformdirs/windows.py
user_data_dir s zWindows.user_data_dirN
opinion_value)r
r r c C st g }| j r`| jdur*| jp| j }|| || j |d urN| jrN|| | jr`|| j tjj|g|R S )NF)ZappnameZ appauthorappendopinionversionr r
join)r r
r paramsZauthorr r r r s
zWindows._append_partsc C s t jtd}| |S )zT:return: data directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname``CSIDL_COMMON_APPDATAr r
r r r r r
r r r
site_data_dir+ s zWindows.site_data_dirc C s | j S )zC:return: config directory tied to the user, same as `user_data_dir`r r r r r user_config_dir1 s zWindows.user_config_dirc C s | j S )zF:return: config directory shared by the users, same as `site_data_dir`)r r" r r r site_config_dir6 s zWindows.site_config_dirc C s t jtd}| j|ddS )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 ZCacher r r r r r user_cache_dir; s zWindows.user_cache_dirc C s | j S )zB:return: state directory tied to the user, same as `user_data_dir`r! r" r r r user_state_dirD s zWindows.user_state_dirc C s | 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)r r r r
r r r r r user_log_dirI s zWindows.user_log_dirc C s t jtdS )z`
:return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents``
CSIDL_PERSONAL)r r
r r r" r r r user_documents_dirS s zWindows.user_documents_dirc C s$ t jt jtdd}| |S )z
:return: runtime directory tied to the user, e.g.
``%USERPROFILE%\AppData\Local\Temp\$appauthor\$appname``
r ZTemp)r r
r r r r r r r r user_runtime_dirZ s zWindows.user_runtime_dir)__name__
__module____qualname____doc__propertystrr r r r r# r$ r% r&