Previous topic

ninjecto.args

Next topic

ninjecto.core

This Page

ninjecto.config

Configuration loading module.

Functions

  • load_config(): Load Ninjecto’s default, system’s, user’s, project’s and given
ninjecto.config.load_config(configs)

Load Ninjecto’s default, system’s, user’s, project’s and given configuration.

The algorithm loads files in the following order:

  1. Package’s default configuration.
  2. System’s configuration from /etc/ninjecto/config.xxx
  3. User’s configuration from $XDG_CONFIG_HOME/ninjecto/config.xxx or $HOME/.config/ninjecto/config.xxx if $XDG_CONFIG_HOME is unavailable.
  4. User’s “alternative” configuration from $HOME/.ninjerc.xxx.
  5. Project’s global configuration from <gitroot>/.ninjerc.xxx <gitroot> is determined by ninjecto.utils.git.find_root(). Currently, git is the only version control system supported.
  6. Project’s “high-priority” local configuration from $PWD/.ninjerc.xxx, but only if $PWD is different from the <gitroot> (if available).
  7. Additional given configuration files, in order.
Parameters
configs (list) – List of paths to configurations files to load.
Returns
Final and merged configuration.
Return type
dict