:py:mod:`appdirs` ================= .. py:module:: conda._vendor.appdirs .. autoapi-nested-parse:: Utilities for determining application-specific dirs. See for details and usage. Classes ------- .. autoapisummary:: conda._vendor.appdirs.AppDirs Functions --------- .. autoapisummary:: conda._vendor.appdirs.user_data_dir conda._vendor.appdirs.site_data_dir conda._vendor.appdirs.user_cache_dir conda._vendor.appdirs.user_log_dir conda._vendor.appdirs._get_win_folder_from_registry conda._vendor.appdirs._get_win_folder_with_pywin32 conda._vendor.appdirs._get_win_folder_with_ctypes Attributes ---------- .. autoapisummary:: conda._vendor.appdirs.__version_info__ conda._vendor.appdirs.__version__ conda._vendor.appdirs.PY3 conda._vendor.appdirs.unicode conda._vendor.appdirs._get_win_folder conda._vendor.appdirs.appname .. py:data:: __version_info__ :value: (1, 2, 0) .. py:data:: __version__ .. py:data:: PY3 .. py:data:: unicode .. py:exception:: AppDirsError Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. .. py:function:: user_data_dir(appname, appauthor=None, version=None, roaming=False) Return full path to the user-specific data dir for this application. "appname" is the name of application. "appauthor" (only required and used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. "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 ".". "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: ~/.config/ # or in $XDG_CONFIG_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_CONFIG_HOME. We don't use $XDG_DATA_HOME as that data dir is mostly used at the time of installation, instead of the application adding data during runtime. Also, in practice, Linux apps tend to store their data in "~/.config/" instead of "~/.local/share/". .. py:function:: site_data_dir(appname, appauthor=None, version=None) Return full path to the user-shared data dir for this application. "appname" is the name of application. "appauthor" (only required and used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. "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 ".". Typical user data directories are: Mac OS X: /Library/Application Support/ Unix: /etc/xdg/ 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_CONFIG_DIRS[0] default. WARNING: Do not use this on Windows. See the Vista-Fail note above for why. .. py:function:: user_cache_dir(appname, appauthor=None, version=None, opinion=True) Return full path to the user-specific cache dir for this application. "appname" is the name of application. "appauthor" (only required and used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. "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 ".". "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. .. py:function:: user_log_dir(appname, appauthor=None, version=None, opinion=True) Return full path to the user-specific log dir for this application. "appname" is the name of application. "appauthor" (only required and used on Windows) is the name of the appauthor or distributing body for this application. Typically it is the owning company name. "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 ".". "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 cache 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. .. py:class:: AppDirs(appname, appauthor, version=None, roaming=False) Bases: :py:obj:`object` Convenience wrapper for getting application dirs. .. py:property:: user_data_dir .. py:property:: site_data_dir .. py:property:: user_cache_dir .. py:property:: user_log_dir .. py:function:: _get_win_folder_from_registry(csidl_name) 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. .. py:function:: _get_win_folder_with_pywin32(csidl_name) .. py:function:: _get_win_folder_with_ctypes(csidl_name) .. py:data:: _get_win_folder .. py:data:: appname :value: 'MyApp'