module config.init
¶
Handle initialization mode.
DEPRECATED: This module is deprecated and will be removed in a future release.
A replacement will be provided in the package :mod:zarp
.
class Initializer
¶
Handler for app initialization.
Attributes:
config
: Configuration model instance.
method __init__
¶
__init__() → None
Class constructor.
method set_from_file
¶
set_from_file(config_file: Path) → None
Set configuration based on configuration file contents.
Args:
config_file
: Path to YAML file containing the initialization configuration.
Raises:
ValueError
: Contents are not valid YAML.
method set_from_user_input
¶
set_from_user_input() → None
Update configuration based on user input.
method write_yaml
¶
write_yaml(contents: BaseModel, path: Path) → None
Write Pydantic model to YAML file.
Args:
contents
::mod:Pydantic
model to be written.path
: Path to YAML output file.
Raises:
OSError
: File could not be written.ValueError
: Contents are not valid YAML.