fprime.fbuild.settings

fprime.fbuild.settings:

An implementation used to pull settings into the fprime build. This version uses INI files in order to load the settings from the settings.default file that is part of the F prime deployment directory.

@author mstarch

Module Contents

Classes

IniSettings()

Class to load settings from INI files

class fprime.fbuild.settings.IniSettings[source]

Class to load settings from INI files

DEF_FILE = settings.ini[source]
SET_ENV = FPRIME_SETTINGS_FILE[source]
static find_fprime()[source]

Finds F prime by recursing parent to parent until a matching directory is found.

static read_safe_path(parser, section, key, ini_file)[source]

Reads path(s), safely, from the config parser. Validates the path(s) exists or raises an exception. Paths are separated by ‘:’. This will also expand relative paths relative to the settings file.

Parameters
  • parser – parser to read from

  • key – key to read from

  • ini_file – ini_file path for clean errors

Returns

path, validated

static load(settings_file)[source]

Load settings from specified file or from specified build directory. Either a specific file or the build directory must be not None.

Parameters
  • settings_file – (optional) file to load settings from (in INI format). Must be specified if build_dir is not.

  • build_dir – (optional) directory to search for settings.ini. Must be specified if file is not.

Returns

a dictionary of needed settings

static load_environment(env_file)[source]

Load the environment from the given parser.

Parameters

env_file – load environment from this file

Returns

environment dictionary

exception fprime.fbuild.settings.FprimeLocationUnknownException[source]

Bases: Exception

Fprime location could not be determined

exception fprime.fbuild.settings.FprimeSettingsException[source]

Bases: Exception

An exception for handling F prime settings misconfiguration

Build: 1.4.1