ats_utilities.generator.gen_params_bundle module¶
- Module
gen_params_bundle.py
- Copyright
Copyright (C) 2017 - 2026 Vladimir Roncevic <elektron.ronca@gmail.com> ats_utilities is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ats_utilities is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
- Info
Defines parameter bundle dataclass for template generation. Encapsulates template generation parameters for simplifcation.
- class ats_utilities.generator.gen_params_bundle.GenParamsBundle(*, archive_path: str, target_dir: str, template_key: str, scheme: str | Mapping[str, Any], template_values: Mapping[str, str])[source]¶
Bases:
objectDefines parameter bundle dataclass for template generation. Encapsulates template generation parameters for simplifcation.
It defines:
- attributes:
- archive_path - Path to the .tgz archive.target_dir - Directory where the project will be generated.template_key - Key for the template configuration.scheme - Scheme configuration file path.template_values - Template values for name case variations.
- methods:
- __post_init__ - Post-initialization hook to validate generator parameters bundle.validate - Validates generator parameters bundle.to_dict - Converts generator parameters bundle to dictionary.
- archive_path: str¶
- scheme: str | Mapping[str, Any]¶
- target_dir: str¶
- template_key: str¶
- template_values: Mapping[str, str]¶
- to_dict() dict[str, Any][source]¶
Converts generator parameters bundle to dictionary.
- Returns:
Dictionary representation of generator parameters bundle.
- Return type:
<dict[str, Any]>
- Exceptions:
None.
- validate() None[source]¶
Validates generator parameters bundle. Performs validation of all bundle attributes. All attributes must be non-None and instances of their respective interfaces.
- Exceptions:
- ATSValueError: Archive path must be provided.ATSValueError: Target dir must be provided.ATSValueError: Template key must be provided.ATSValueError: Scheme must be provided.ATSValueError: Template values must be provided.ATSTypeError: Archive path must be a string.ATSTypeError: Target dir must be a string.ATSTypeError: Template key must be a string.ATSTypeError: Scheme must be a string or a mapping.ATSTypeError: Template values must be a mapping.ATSValueError: Archive file does not exist.ATSValueError: Scheme file does not exist.