Environment
Utilitary module to interact with environment variables.
- WANTED_XDG_DATA_PATH = PosixPath('/home/docs/.local/share/command-line-assistant')
The wanted xdg data path in case $XDG_DATA_HOME is not defined.
- WANTED_XDG_PATH = PosixPath('/etc/xdg')
The wanted xdg path where the configuration files will live.
- WANTED_XDG_STATE_PATH = PosixPath('/home/docs/.local/state/command-line-assistant')
The wanted xdg state path in case $XDG_STATE_HOME is not defined.
- get_xdg_config_path()[source]
Check for the existence of XDG_CONFIG_DIRS environment variable.
In case it is not present, this function will return the default path that is
/etc/xdg, which is where we want to locate our configuration file for Command Line Assistant.$XDG_CONFIG_DIRS defines the preference-ordered set of base directories to search for configuration files in addition to the $XDG_CONFIG_HOME base directory. The first entry in the variable that exists will be returned. :rtype:
PathNote
Usually, XDG_CONFIG_DIRS is represented as multi-path separated by a “:” where all the configurations files could live. This is not particularly useful to us, so we read the environment (if present), parse that, and extract only the wanted path (/etc/xdg).
Ref: https://specifications.freedesktop.org/basedir-spec/latest/
- get_xdg_data_path()[source]
Check for the existence of XDG_DATA_HOME environment variable.
In case it is not present, this function will return the default path that is
~/.local/share, which is where we want to place data files for Command Line Assistant.See: https://specifications.freedesktop.org/basedir-spec/latest/
- Return type:
- get_xdg_state_path()[source]
Check for the existence of XDG_STATE_HOME environment variable.
In case it is not present, this function will return the default path that is
~/.local/state, which is where we want to place temporary state files for Command Line Assistant.See: https://specifications.freedesktop.org/basedir-spec/latest/
- Return type: