BaseSection

class ase2sprkkr.common.configuration_containers.BaseSection(definition, container=None)[source]

A section of SPRKKR configuration - i.e. part of the configuration file.

Class hierarchy

Inheritance diagram of ase2sprkkr.common.configuration_containers.BaseSection

Constructor

__init__(definition, container=None)

Create the container and its members, according to the definition

has_any_value()[source]

Return True if any member of the section has value.

Returns

has_any_value – True, if no value in the container is set, False otherwise

Return type

bool

validate(why='save')[source]

Validate the configuration data. Raise an exception, if the validation fail.

Parameters

why (str) – Type of the validation. Possible values save - Full validation, during save. set - Validation on user input. Allow required values not to be set. parse - Validation during parsing - some check, that are enforced by the parser, can be skipped.

_save_to_file(file)[source]

Save the content of the container to the file (according to the definition)

Parameters

file (file) – File object (open for writing), where the data should be written

Returns

If any value have been written return True, otherwise return False.

Return type

something_have_been_written