gen_avr8.infrastructure.subprocessor module

Module

subprocessor.py

Copyright

Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com> gen_avr8 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. gen_avr8 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 sub-processor adapter implementing ISubProcessor.

class gen_avr8.infrastructure.subprocessor.SubProcessor(generator: IGeneratorManager)[source]

Bases: object

Adapter that executes sub-processes.

It defines:

attributes:
_scheme - Path to the scheme json file.
_templates - Path to the templates tgz file.
_generator - Generator manager used to generate code from templates.
_logger - Logger used to log messages.
methods:
run - Executes a sub-process.
is_initialized - Checks if the subprocessor is initialized.
__str__ - Returns the SubProcessor as string representation.
_generator: IGeneratorManager
_logger: ILogger
_scheme: str = 'config/scheme.json'
_templates: str = 'config/templates.tgz'
is_initialized() bool[source]

Checks if the subprocessor is initialized.

Returns:

True if the subprocessor is initialized, False otherwise.

Exceptions:

None.

run(*, params: Mapping[str, object]) Mapping[str, object][source]

Executes the generator.

Parameters:

params – The command parameters for generator.

Returns:

Return code, stdout and stderr messages.

Exceptions:

None.