ó â\e[c@s4dZd/ZdjeeeƒƒZddlZddlZejddkZ e r^eZ nej j dƒrÉddl Z e j ƒddZej d ƒr¨d ZqŇej d ƒrŔd ZqŇd Zn ej Zddded„Zddded„Zddded„Zddded„Zddded„Zddded„Zddded„Zdefd„ƒYZd„Zd„Zd„Zd„Zed kr yddl m!Z!eZ"Wq e#k ryddl$Z%eZ"Wq e#k reZ"q Xq Xne&dkr0dZ'dZ(d0Z)d&eGHd'GHee'e(d(d)ƒZ*x&e)D]Z+d*e+e,e*e+ƒfGHqTWd+GHee'e(ƒZ*x&e)D]Z+d*e+e,e*e+ƒfGHq‘Wd,GHee'ƒZ*x&e)D]Z+d*e+e,e*e+ƒfGHqËWd-GHee'd.eƒZ*x)e)D]Z+d*e+e,e*e+ƒfGHq WndS(1syUtilities for determining application-specific dirs. See for details and usage. iiit.i˙˙˙˙NitjavatWindowstwin32tMactdarwintlinux2cCs6tdkr“|dkr!|}n|r-dp0d}tjjt|ƒƒ}|r|tk rxtjj|||ƒ}qtjj||ƒ}qn{tdkrŇtjjdƒ}|rtjj||ƒ}qn<tj dtjjdƒƒ}|rtjj||ƒ}n|r2|r2tjj||ƒ}n|S( sJReturn full path to the user-specific data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user data directories are: Mac OS X: ~/Library/Application Support/ Unix: ~/.local/share/ # or in $XDG_DATA_HOME, if defined Win XP (not roaming): C:\Documents and Settings\\Application Data\\ Win XP (roaming): C:\Documents and Settings\\Local Settings\Application Data\\ Win 7 (not roaming): C:\Users\\AppData\Local\\ Win 7 (roaming): C:\Users\\AppData\Roaming\\ For Unix, we follow the XDG spec and support $XDG_DATA_HOME. That means, by default "~/.local/share/". Rt CSIDL_APPDATAtCSIDL_LOCAL_APPDATARs~/Library/Application Support/t XDG_DATA_HOMEs~/.local/shareN( tsystemtNonetostpathtnormpatht_get_win_foldertFalsetjoint expandusertgetenv(tappnamet appauthortversiontroamingtconstR ((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyt user_data_dir-s&      cCsÄtdkr|d kr!|}ntjjtdƒƒ}|rœ|tk rftjj|||ƒ}q~tjj||ƒ}qœntdkrŔtjjdƒ}|rœtjj||ƒ}qœnÜtj dtj jddgƒƒ}g|j tj ƒD]$}tjj|j tj ƒƒ^q÷}|rs|rEtjj||ƒ}ng|D]}tj j||gƒ^qL}n|rŽtj j|ƒ}n |d}|S|rŔ|rŔtjj||ƒ}n|S( siReturn full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "multipath" is an optional parameter only applicable to *nix which indicates that the entire list of data dirs should be returned. By default, the first item from XDG_DATA_DIRS is returned, or '/usr/local/share/', if XDG_DATA_DIRS is not set Typical site data directories are: Mac OS X: /Library/Application Support/ Unix: /usr/local/share/ or /usr/share/ Win XP: C:\Documents and Settings\All Users\Application Data\\ Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) Win 7: C:\ProgramData\\ # Hidden, but writeable on Win 7. For Unix, this is using the $XDG_DATA_DIRS[0] default. WARNING: Do not use this on Windows. See the Vista-Fail note above for why. RtCSIDL_COMMON_APPDATARs/Library/Application Supportt XDG_DATA_DIRSs/usr/local/shares /usr/shareiN(R R R R RRRRRRtpathseptsplittrstriptsep(RRRt multipathR txtpathlist((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyt site_data_dirds4      =.  cCsˆtdkr$t||d|ƒ}n<tjdtjjdƒƒ}|r`tjj||ƒ}n|r„|r„tjj||ƒ}n|S(sÔReturn full path to the user-specific config dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user config directories are: Mac OS X: same as user_data_dir Unix: ~/.config/ # or in $XDG_CONFIG_HOME, if defined Win *: same as user_data_dir For Unix, we follow the XDG spec and support $XDG_CONFIG_HOME. That means, by default "~/.config/". RRtXDG_CONFIG_HOMEs ~/.config(swin32sdarwinN(R RR R RR RR(RRRRR ((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pytuser_config_dirŚs  cCs tdkrBt||ƒ}|r|rtjj||ƒ}qnĆtjddƒ}g|jtjƒD]$}tjj|j tj ƒƒ^qg}|ră|rľtjj||ƒ}ng|D]}tj j||gƒ^qź}n|rţtjj|ƒ}n |d}|S(sReturn full path to the user-shared data dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "multipath" is an optional parameter only applicable to *nix which indicates that the entire list of config dirs should be returned. By default, the first item from XDG_CONFIG_DIRS is returned, or '/etc/xdg/', if XDG_CONFIG_DIRS is not set Typical site config directories are: Mac OS X: same as site_data_dir Unix: /etc/xdg/ or $XDG_CONFIG_DIRS[i]/ for each value in $XDG_CONFIG_DIRS Win *: same as site_data_dir Vista: (Fail! "C:\ProgramData" is a hidden *system* directory on Vista.) For Unix, this is using the $XDG_CONFIG_DIRS[0] default, if multipath=False WARNING: Do not use this on Windows. See the Vista-Fail note above for why. RRtXDG_CONFIG_DIRSs/etc/xdgi(swin32sdarwin( R R#R R RRRRRRR(RRRR R R!R"((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pytsite_config_dirÎs  =. cCsBtdkrŸ|dkr!|}ntjjtdƒƒ}|r|tk rftjj|||ƒ}ntjj||ƒ}|rœtjj|dƒ}qœqn{tdkrŢtjjdƒ}|rtjj||ƒ}qn<tj dtjjdƒƒ}|rtjj||ƒ}n|r>|r>tjj||ƒ}n|S( sReturn full path to the user-specific cache dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "opinion" (boolean) can be False to disable the appending of "Cache" to the base app data dir for Windows. See discussion below. Typical user cache directories are: Mac OS X: ~/Library/Caches/ Unix: ~/.cache/ (XDG default) Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Cache Vista: C:\Users\\AppData\Local\\\Cache On Windows the only suggestion in the MSDN docs is that local settings go in the `CSIDL_LOCAL_APPDATA` directory. This is identical to the non-roaming app data dir (the default returned by `user_data_dir` above). Apps typically put cache data somewhere *under* the given dir here. Some examples: ...\Mozilla\Firefox\Profiles\\Cache ...\Acme\SuperApp\Cache\1.0 OPINION: This function appends "Cache" to the `CSIDL_LOCAL_APPDATA` value. This can be disabled with the `opinion=False` option. RRtCacheRs~/Library/CachestXDG_CACHE_HOMEs~/.cacheN( R R R R RRRRRR(RRRtopinionR ((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pytuser_cache_dirs(!      cCsˆtdkr$t||d|ƒ}n<tjdtjjdƒƒ}|r`tjj||ƒ}n|r„|r„tjj||ƒ}n|S(sReturn full path to the user-specific state dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "roaming" (boolean, default False) can be set True to use the Windows roaming appdata directory. That means that for users on a Windows network setup for roaming profiles, this user data will be sync'd on login. See for a discussion of issues. Typical user state directories are: Mac OS X: same as user_data_dir Unix: ~/.local/state/ # or in $XDG_STATE_HOME, if defined Win *: same as user_data_dir For Unix, we follow this Debian proposal to extend the XDG spec and support $XDG_STATE_HOME. That means, by default "~/.local/state/". RRtXDG_STATE_HOMEs~/.local/state(swin32sdarwinN(R RR R RR RR(RRRRR ((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pytuser_state_dir:s  cCsÓtdkr0tjjtjjdƒ|ƒ}n{tdkrut|||ƒ}t}|rŤtjj|dƒ}qŤn6t|||ƒ}t}|rŤtjj|dƒ}n|rĎ|rĎtjj||ƒ}n|S(s˝Return full path to the user-specific log dir for this application. "appname" is the name of application. If None, just the system directory is returned. "appauthor" (only used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. This falls back to appname. You may pass False to disable it. "version" is an optional version path element to append to the path. You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ".". Only applied when appname is present. "opinion" (boolean) can be False to disable the appending of "Logs" to the base app data dir for Windows, and "log" to the base cache dir for Unix. See discussion below. Typical user log directories are: Mac OS X: ~/Library/Logs/ Unix: ~/.cache//log # or under $XDG_CACHE_HOME if defined Win XP: C:\Documents and Settings\\Local Settings\Application Data\\\Logs Vista: C:\Users\\AppData\Local\\\Logs On Windows the only suggestion in the MSDN docs is that local settings go in the `CSIDL_LOCAL_APPDATA` directory. (Note: I'm interested in examples of what some windows apps use for a logs dir.) OPINION: This function appends "Logs" to the `CSIDL_LOCAL_APPDATA` value for Windows and appends "log" to the user cache dir for Unix. This can be disabled with the `opinion=False` option. Rs~/Library/LogsRtLogstlog(R R R RRRRR+(RRRR*R ((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyt user_log_dirds     tAppDirscBseZdZd d d eed„Zed„ƒZed„ƒZed„ƒZ ed„ƒZ ed„ƒZ ed„ƒZ ed„ƒZ RS( s1Convenience wrapper for getting application dirs.cCs1||_||_||_||_||_dS(N(RRRRR (tselfRRRRR ((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyt__init__™s     cCs%t|j|jd|jd|jƒS(NRR(RRRRR(R2((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyRĄscCs%t|j|jd|jd|jƒS(NRR (R#RRRR (R2((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyR#ŚscCs%t|j|jd|jd|jƒS(NRR(R%RRRR(R2((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyR%ŤscCs%t|j|jd|jd|jƒS(NRR (R'RRRR (R2((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyR'°scCst|j|jd|jƒS(NR(R+RRR(R2((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyR+ľscCst|j|jd|jƒS(NR(R-RRR(R2((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyR-şscCst|j|jd|jƒS(NR(R0RRR(R2((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyR0żsN(t__name__t __module__t__doc__R RR3tpropertyRR#R%R'R+R-R0(((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyR1—s cCsqtrddl}n ddl}idd6dd6dd6|}|j|jd ƒ}|j||ƒ\}}|S( s–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. i˙˙˙˙NtAppDataRsCommon AppDataRs Local AppDataRs@Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders(tPY3twinregt_winregtOpenKeytHKEY_CURRENT_USERt QueryValueEx(t csidl_nameR;tshell_folder_nametkeytdirttype((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyt_get_win_folder_from_registryÇs  cCsÎddlm}m}|jdt||ƒddƒ}yt|ƒ}t}x*|D]"}t|ƒdkrSt}PqSqSW|rľyddl }|j |ƒ}Wqľt k rąqľXnWnt k rÉnX|S(Ni˙˙˙˙(tshellcontshellii˙( twin32com.shellRERFtSHGetFolderPathtgetattrtunicodeRtordtTruetwin32apitGetShortPathNamet ImportErrort UnicodeError(R?RERFRBt has_high_chartcRM((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyt_get_win_folder_with_pywin32ßs$!      cCsŇddl}idd6dd6dd6|}|jdƒ}|jjjd|dd |ƒt}x*|D]"}t|ƒd krft}PqfqfW|rË|jdƒ}|jj j |j |dƒrË|}qËn|j S( Ni˙˙˙˙iRi#RiRiii˙( tctypestcreate_unicode_buffertwindlltshell32tSHGetFolderPathWR RRKRLtkernel32tGetShortPathNameWtvalue(R?RTt csidl_consttbufRQRRtbuf2((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyt_get_win_folder_with_ctypesús$   c Cs=ddl}ddlm}ddlm}|jjd}|jd|ƒ}|jj }|j dt |j |ƒd|j j|ƒ|jj|jƒƒjdƒ}t}x*|D]"} t| ƒdkrłt}PqłqłW|r9|jd|ƒ}|jj } | j|||ƒr9|jj|jƒƒjdƒ}q9n|S(Ni˙˙˙˙(tjna(RiRRti˙(tarraytcom.sunR`tcom.sun.jna.platformRtWinDeftMAX_PATHtzerostShell32tINSTANCERHR RItShlObjtSHGFP_TYPE_CURRENTtNativettoStringttostringRRRKRLtKernel32RN( R?RbR`Rtbuf_sizeR]RFRBRQRRtkernel((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyt_get_win_folder_with_jnas&  +!  '(RVt__main__tMyAppt MyCompanyRR%R+R-R0R#R's-- app dirs %s --s%-- app dirs (with optional 'version')Rs1.0s%s: %ss) -- app dirs (without optional 'version')s+ -- app dirs (without optional 'appauthor')s( -- app dirs (with disabled 'appauthor')R(iii(s user_data_dirsuser_config_dirsuser_cache_dirsuser_state_dirs user_log_dirs site_data_dirssite_config_dir(-R6t__version_info__Rtmaptstrt __version__tsysR t version_infoR9RJtplatformt startswithtjava_vertos_nameR R RRR#R%R'RLR+R-R0tobjectR1RDRSR_RrRTRVRROt com.sun.jnatcomR4RRtpropstdirstpropRI(((s2/tmp/pip-install-0xiv62/pip/pip/_vendor/appdirs.pyt s‚        7B(39*30