Config
sereto.models.config
¶
ConfigModel
¶
Bases: SeretoBaseModel
Model representing the full project configuration in config.json file.
Attributes:
Name | Type | Description |
---|---|---|
sereto_version |
SeretoVersion
|
Version of SeReTo which produced the config. |
version_configs |
dict[ProjectVersion, VersionConfigModel]
|
Configuration for each version of the Project. |
Source code in sereto/models/config.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
load_from(file)
classmethod
¶
Load the configuration from a JSON file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file
|
FilePath
|
The path to the configuration file. |
required |
Returns:
Type | Description |
---|---|
Self
|
The configuration object. |
Raises:
Type | Description |
---|---|
SeretoPathError
|
If the file is not found or permission is denied. |
SeretoValueError
|
If the configuration is invalid. |
Source code in sereto/models/config.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
VersionConfigModel
¶
Bases: SeretoBaseModel
Model with core attributes for a specific version of the project configuration.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
The ID of the project. |
name |
str
|
The name of the project. |
version_description |
str
|
The description of the version (e.g. "retest"). |
targets |
list[TargetModel]
|
List of targets. |
dates |
list[Date]
|
List of dates. |
people |
list[Person]
|
List of people. |
Source code in sereto/models/config.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|