spinn_utilities.configs package

Module contents

class spinn_utilities.configs.CamelCaseConfigParser(defaults=None)[source]

Bases: configparser.RawConfigParser

get_bool(section, option)[source]

Get the boolean value of an option.

Parameters:
  • section (str) – What section to get the option from.
  • option (str) – What option to read.
Returns:

The option value.

Return type:

bool

get_float(section, option)[source]

Get the float value of an option.

Parameters:
  • section (str) – What section to get the option from.
  • option (str) – What option to read.
Returns:

The option value.

Return type:

float

get_int(section, option)[source]

Get the integer value of an option.

Parameters:
  • section (str) – What section to get the option from.
  • option (str) – What option to read.
Returns:

The option value

Return type:

int

get_str(section, option)[source]

Get the string value of an option.

Parameters:
  • section (str) – What section to get the option from.
  • option (str) – What option to read.
Returns:

The option value

Return type:

str or None

get_str_list(section, option, token=', ')[source]

Get the string value of an option split into a list.

Parameters:
  • section (str) – What section to get the option from.
  • option (str) – What option to read.
  • token – The token to split the string into a list
Returns:

The list (possibly empty) of the option values

Return type:

list(str)

optionxform(optionstr)[source]

Transforms the name of an option to lower case and strips underscores, so matching is more user-friendly.

read(filenames, encoding=None)[source]

Read and parse a filename or a list of filenames.

read_files

The configuration files that have been actually read.

class spinn_utilities.configs.CaseSensitiveParser(defaults=None, dict_type=<class 'dict'>, allow_no_value=False, *, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section='DEFAULT', interpolation=<object object>, converters=<object object>)[source]

Bases: configparser.RawConfigParser

optionxform(optionstr)[source]

Performs no transformation of option strings.

exception spinn_utilities.configs.ConfigTemplateException[source]

Bases: Exception

Throws when an existing Section has an extra config value

exception spinn_utilities.configs.NoConfigFoundException[source]

Bases: Exception

Throws when an existing Section has an extra config value

exception spinn_utilities.configs.UnexpectedConfigException[source]

Bases: Exception

Throws when an existing Section has an extra config value