**************** wx.StandardPaths **************** Inheritance diagram for `wx.StandardPaths`: | .. inheritance-diagram:: wx.StandardPaths | Description =========== `wx.StandardPaths` returns the standard locations in the file system and should be used by applications to find their data files in a portable way. In the description of the methods below, the example return values are given for the Unix, Windows and Mac OS X systems, however please note that these are just the examples and the actual values may differ. For example, under Windows: the system administrator may change the standard directories locations, i.e. the Windows directory may be named ``W:\Win2003`` instead of the default ``C:\Windows``. The strings `appname` and `username` should be replaced with the value returned by `wx.App.GetAppName `_ and the name of the currently logged in user, respectively. The string `prefix` is only used under Unix and is ``/usr/local`` by default but may be changed using `SetInstallPrefix <#SetInstallPrefix>`_. The directories returned by the methods of this class may or may not exist. If they don't exist, it's up to the caller to create them, `wx.StandardPaths` doesn't do it. .. note:: Finally note that these functions only work with standardly packaged applications. I.e. under Unix you should follow the standard installation conventions and under Mac you should create your application bundle according to the Apple guidelines. Again, this class doesn't help you to do it. This class is MT-safe: its methods may be called concurrently from different threads without additional locking. .. note:: Note that you don't allocate an instance of class `wx.StandardPaths`, but retrieve the global standard paths object using `wx.StandardPaths.Get <#Get>`_ on which you call the desired methods. Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Get <#Get>`_ * `GetConfigDir <#GetConfigDir>`_ * `GetDataDir <#GetDataDir>`_ * `GetDocumentsDir <#GetDocumentsDir>`_ * `GetExecutablePath <#GetExecutablePath>`_ * `GetInstallPrefix <#GetInstallPrefix>`_ * `GetLocalDataDir <#GetLocalDataDir>`_ * `GetLocalizedResourcesDir <#GetLocalizedResourcesDir>`_ * `GetPluginsDir <#GetPluginsDir>`_ * `GetResourcesDir <#GetResourcesDir>`_ * `GetTempDir <#GetTempDir>`_ * `GetUserConfigDir <#GetUserConfigDir>`_ * `GetUserDataDir <#GetUserDataDir>`_ * `GetUserLocalDataDir <#GetUserLocalDataDir>`_ * `SetInstallPrefix <#SetInstallPrefix>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__() `No docstrings available for this method.` -------- .. method:: Get() Returns reference to the unique global standard paths object. | **Returns:** `wx.StandardPaths `_ -------- .. method:: GetConfigDir() Return the directory containing the system config files. Example return values: * Unix: ``/etc`` * Windows: ``C:\Documents and Settings\All Users\Application Data`` * Mac: ``/Library/Preferences`` | **Returns:** `string` .. seealso:: `wx.FileConfig `_ -------- .. method:: GetDataDir() Return the location of the applications global, i.e. not user-specific, data files. Example return values: * Unix: ``*prefix*/share/*appname*`` * Windows: the directory where the executable file is located * Mac: ``*appname*.app/Contents/SharedSupport`` bundle subdirectory | **Returns:** `string` .. seealso:: `GetLocalDataDir <#GetLocalDataDir>`_ -------- .. method:: GetDocumentsDir() Return the directory containing the current user's documents. Example return values: * Unix: ``~`` (the home directory) * Windows: ``C:\Documents and Settings\*username*\Documents`` * Mac: ``~/Documents`` This function is new since wxWidgets version 2.7.0 | **Returns:** `string` -------- .. method:: GetExecutablePath() Return the directory and the filename for the current executable. Example return values: * Unix: ``/usr/local/bin/exename`` * Windows: ``C:\Programs\AppFolder\exename.exe`` * Mac: ``/Programs/exename`` | **Returns:** `string` -------- .. method:: GetInstallPrefix() Return the program installation prefix, e.g. ``/usr``, ``/opt`` or ``/home/zeitlin``. If the prefix had been previously by `SetInstallPrefix <#SetInstallPrefix>`_, returns that value, otherwise tries to determine it automatically (Linux only right now) and finally returns the default ``/usr/local`` value if it failed. | **Returns:** `string` .. note:: This function is only available under Unix. -------- .. method:: GetLocalDataDir() Return the location for application data files which are host-specific and can't, or shouldn't, be shared with the other machines. This is the same as `GetDataDir <#GetDataDir>`_ except under Unix where it returns ``/etc/*appname*``. | **Returns:** `string` -------- .. method:: GetLocalizedResourcesDir(lang, category=int) Return the localized resources directory containing the resource files of the specified category for the given language. In general this is just the same as `lang` subdirectory of `GetResourcesDir <#GetResourcesDir>`_ (or ``*lang*.lproj`` under Mac OS X) but is something quite different for message catalog category under Unix where it returns the standard ``*prefix*/share/locale/*lang*/LC_MESSAGES`` directory. This function is new since wxWidgets version 2.7.0 **Parameters:** * `lang` (string) * `category` (int) | **Returns:** `string` -------- .. method:: GetPluginsDir() Return the directory where the loadable modules (plugins) live. Example return values: * Unix: ``*prefix*/lib/*appname*`` * Windows: the directory of the executable file * Mac: ``*appname*.app/Contents/PlugIns`` bundle subdirectory | **Returns:** `string` -------- .. method:: GetResourcesDir() Return the directory where the application resource files are located. The resources are the auxiliary data files needed for the application to run and include, for example, image and sound files it might use. This function is the same as `GetDataDir <#GetDataDir>`_ for all platforms except Mac OS X. Example return values: * Unix: ``*prefix*/share/*appname*`` * Windows: the directory where the executable file is located * Mac: ``*appname*.app/Contents/Resources`` bundle subdirectory This function is new since wxWidgets version 2.7.0 | **Returns:** `string` .. seealso:: `GetLocalizedResourcesDir <#GetLocalizedResourcesDir>`_ -------- .. method:: GetTempDir() Return the directory for storing temporary files. This function is new since wxWidgets version 2.7.2 | **Returns:** `string` -------- .. method:: GetUserConfigDir() Return the directory for the user config files: * Unix: ``~`` (the home directory) * Windows: ``C:\Documents and Settings\*username*\Application Data`` * Mac: ``~/Library/Preferences`` Only use this method if you have a single configuration file to put in this directory, otherwise `GetUserDataDir <#GetUserDataDir>`_ is more appropriate. | **Returns:** `string` -------- .. method:: GetUserDataDir() Return the directory for the user-dependent application data files: * Unix: ``~/.*appname*`` * Windows: ``C:\Documents and Settings\*username*\Application Data\*appname*`` * Mac: ``~/Library/Application Support/*appname*`` | **Returns:** `string` -------- .. method:: GetUserLocalDataDir() Return the directory for user data files which shouldn't be shared with the other machines. This is the same as `GetUserDataDir <#GetUserDataDir>`_ for all platforms except Windows where it returns ``C:\Documents and Settings\*username*\Local Settings\Application Data\*appname*`` | **Returns:** `string` -------- .. method:: SetInstallPrefix(prefix) Lets `wx.StandardPaths` know about the real program installation prefix on a Unix system. By default, the value returned by `GetInstallPrefix <#GetInstallPrefix>`_ is used. Although under Linux systems the program prefix may usually be determined automatically, portable programs should call this function. **Parameters:** * `prefix` (string) .. note:: This function is only available under Unix.