spinn_utilities.configs package

Module contents

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

Bases: RawConfigParser

Extends the Parser to allow for differences in case and underscores

get_bool(section: str, option: str) bool | None[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: str, option: str) float | None[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: str, option: str) int | None[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: str, option: str) str | None[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: str, option: str, token: str = ',') List[str][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: str) str[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.

property read_files

The configuration files that have been actually read.

exception spinn_utilities.configs.ConfigTemplateException[source]

Bases: Exception

Throws when a problem is found with a configuration template.

exception spinn_utilities.configs.NoConfigFoundException[source]

Bases: Exception

Thrown when no configuration value is found.

exception spinn_utilities.configs.UnexpectedConfigException[source]

Bases: Exception

Thrown when an existing Section has an extra configuration value.