źhddlmZddlZddlZddlZddlmZddlmZddl m Z Gdde Z dd Z dd Z ddZddZedeZdgZdS)) annotationsN) lru_cache)Callable)PlatformDirsABCceZdZdZeddZdddd Zedd Zedd Zedd Z eddZ eddZ eddZ eddZ eddZdS)Windowsa`MSDN on where to store app data files `_. Makes use of the `appname `, `appauthor `, `version `, `roaming `, `opinion `.returnstrc|jrdnd}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)roamingospathnormpathget_win_folder _append_parts)selfconstrs /builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/pkg_resources/_vendor/platformdirs/windows.py user_data_dirzWindows.user_data_dirsF$(<J5Jwu 5 566!!$'''N opinion_valuerr str | NonecLg}|jr|jdur#|jp|j}||||j||jr|||jr||jt jj|g|RS)NF)appname appauthorappendopinionversionrrjoin)rrrparamsauthors rrzWindows._append_parts!s < ,~U**74< f%%% MM$, ' ' '(T\( m,,,| , dl+++w|D*6****rctjtd}||S)zT:return: data directory shared by users, e.g. ``C:\ProgramData\$appauthor\$appname``CSIDL_COMMON_APPDATArrrrrrrs r site_data_dirzWindows.site_data_dir.s6w/E F FGG!!$'''rc|jS)zC:return: config directory tied to the user, same as `user_data_dir`rrs ruser_config_dirzWindows.user_config_dir4 !!rc|jS)zF:return: config directory shared by the users, same as `site_data_dir`)r*r-s rsite_config_dirzWindows.site_config_dir9r/rctjtd}||dS)z :return: cache directory tied to the user (if opinionated with ``Cache`` folder within ``$appname``) e.g. ``%USERPROFILE%\AppData\Local\$appauthor\$appname\Cache\$version`` rCacherr(r)s ruser_cache_dirzWindows.user_cache_dir>s; w/D E EFF!!$g!>>>rc|jS)zB:return: state directory tied to the user, same as `user_data_dir`r,r-s ruser_state_dirzWindows.user_state_dirGr/rcb|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)rr!rrr#r)s r user_log_dirzWindows.user_log_dirLs0 ! < .7<<f--D rcZtjtdS)z` :return: documents directory tied to the user e.g. ``%USERPROFILE%\Documents`` CSIDL_PERSONAL)rrrrr-s ruser_documents_dirzWindows.user_documents_dirVs# w/? @ @AAArctjtjt dd}||S)z :return: runtime directory tied to the user, e.g. ``%USERPROFILE%\AppData\Local\Temp\$appauthor\$appname`` rTemp)rrrr#rrr)s ruser_runtime_dirzWindows.user_runtime_dir]sG w ^>LIq y>>rcddddd|}|td|tjd}t td }|jd|dd |td |Dr7tjd}|j |j |dr|}|j S) zGet folder with ctypes.#rWNrMiwindllrc3<K|]}t|dkVdS)N)ord).0cs r z,get_win_folder_via_ctypes..s, % %A3q66C< % % % % % %r) rOrPctypescreate_unicode_buffergetattrshell32SHGetFolderPathWanykernel32GetShortPathNameWvalue)rF csidl_constbufrjbuf2s rget_win_folder_via_ctypesr}s "!   c*oo  < <<===  &t , ,C VX & &F N##D+tQDDD % % % % %%%+D11 ? , ,SYd C C C 9rCallable[[str], str]cttdrtS ddl}tS#t $r t cYSwxYw)Nrjr)hasattrrqr}r\rd ImportErrorrS)r\s r_pick_get_win_folderrsYvx  )((, ,+ ,,,++++,s )==)maxsize)rFr r r )r r~) __future__rrqrrY functoolsrtypingrapirr rSrdr}rr__all__rErrrs#""""""  X(X(X(X(X(oX(X(X(v$00,,,,)4((()=)=)?)?@@ r